Spaces:
Runtime error
Runtime error
Add fast-foreground-estimation in masking image.
Browse files
app.py
CHANGED
@@ -149,7 +149,7 @@ def predict(images, resolution, weights_file):
|
|
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()
|
155 |
|
|
|
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.fromarray(image).size))
|
153 |
|
154 |
torch.cuda.empty_cache()
|
155 |
|