sb10
Browse files
app.py
CHANGED
|
@@ -25,16 +25,15 @@ net_c=net_c.to('cpu')
|
|
| 25 |
net_i.eval().to('cuda')
|
| 26 |
net_c.eval().to('cuda')
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
@spaces.GPU(duration=120)
|
| 33 |
def align(x1):
|
| 34 |
h, w = x1.shape[-2], x1.shape[-1]
|
| 35 |
h, w = h // 32 * 32, w // 32 * 32
|
| 36 |
x1 = torch.nn.functional.interpolate(x1, size=(h, w), mode='bilinear')
|
| 37 |
return x1
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
def predict(img):
|
| 39 |
with torch.no_grad():
|
| 40 |
image_tensor = torch.from_numpy(img).permute(2, 0, 1).float().unsqueeze(0)
|
|
|
|
| 25 |
net_i.eval().to('cuda')
|
| 26 |
net_c.eval().to('cuda')
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
def align(x1):
|
| 29 |
h, w = x1.shape[-2], x1.shape[-1]
|
| 30 |
h, w = h // 32 * 32, w // 32 * 32
|
| 31 |
x1 = torch.nn.functional.interpolate(x1, size=(h, w), mode='bilinear')
|
| 32 |
return x1
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
@spaces.GPU(duration=120)
|
| 37 |
def predict(img):
|
| 38 |
with torch.no_grad():
|
| 39 |
image_tensor = torch.from_numpy(img).permute(2, 0, 1).float().unsqueeze(0)
|