Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -159,7 +159,7 @@ def predict(images, resolution, weights_file):
|
|
159 |
save_paths.append(save_file_path)
|
160 |
|
161 |
# Apply the prediction mask to the original image
|
162 |
-
pred = torch.nn.functional.interpolate(preds, size=image_shape, mode='bilinear', align_corners=True).numpy()
|
163 |
image_pil = image_pil.resize(pred.shape[::-1])
|
164 |
pred = np.repeat(np.expand_dims(pred, axis=-1), 3, axis=-1)
|
165 |
image_masked = (pred * np.array(image_pil)).astype(np.uint8)
|
|
|
159 |
save_paths.append(save_file_path)
|
160 |
|
161 |
# Apply the prediction mask to the original image
|
162 |
+
pred = torch.nn.functional.interpolate(preds, size=image_shape, mode='bilinear', align_corners=True).squeeze().numpy()
|
163 |
image_pil = image_pil.resize(pred.shape[::-1])
|
164 |
pred = np.repeat(np.expand_dims(pred, axis=-1), 3, axis=-1)
|
165 |
image_masked = (pred * np.array(image_pil)).astype(np.uint8)
|