Update app.py
Browse files
app.py
CHANGED
@@ -48,8 +48,9 @@ def inference_instance(image):
|
|
48 |
instance_seg_mask = result["segmentation"].cpu().detach().numpy()
|
49 |
|
50 |
instance_seg_mask_disp = visualize_instance_seg_mask(instance_seg_mask)
|
51 |
-
|
52 |
-
st.image(image, caption='Result')
|
53 |
|
54 |
image = Image.open(file).convert("RGB")
|
55 |
-
inference_instance(image)
|
|
|
|
|
|
48 |
instance_seg_mask = result["segmentation"].cpu().detach().numpy()
|
49 |
|
50 |
instance_seg_mask_disp = visualize_instance_seg_mask(instance_seg_mask)
|
51 |
+
return instance_seg_mask_disp
|
|
|
52 |
|
53 |
image = Image.open(file).convert("RGB")
|
54 |
+
mask = inference_instance(image)
|
55 |
+
image.paste(mask, (0, 0), mask)
|
56 |
+
st.image(image, caption='Result')
|