Spaces:
Runtime error
Runtime error
Add fast-foreground-estimation in masking image.
Browse files
app.py
CHANGED
@@ -148,7 +148,7 @@ def predict(images, resolution, weights_file):
|
|
148 |
|
149 |
# Show Results
|
150 |
pred_pil = transforms.ToPILImage()(pred)
|
151 |
-
image_masked = refine_foreground(image, pred_pil)
|
152 |
image_masked.putalpha(pred_pil.resize(image.size))
|
153 |
|
154 |
torch.cuda.empty_cache()
|
|
|
148 |
|
149 |
# Show Results
|
150 |
pred_pil = transforms.ToPILImage()(pred)
|
151 |
+
image_masked = refine_foreground(Image.fromarray(image), pred_pil)
|
152 |
image_masked.putalpha(pred_pil.resize(image.size))
|
153 |
|
154 |
torch.cuda.empty_cache()
|