Spaces:
Runtime error
Runtime error
fix plot image with mask
Browse files
app.py
CHANGED
|
@@ -118,7 +118,7 @@ def process_big_images(
|
|
| 118 |
outputs = segment(Image.fromarray(img))
|
| 119 |
msk = post_processing(outputs, target_size)
|
| 120 |
|
| 121 |
-
return Mask(msk)
|
| 122 |
|
| 123 |
|
| 124 |
def image_with_mask(
|
|
@@ -156,9 +156,9 @@ def categories_map(
|
|
| 156 |
|
| 157 |
|
| 158 |
def main(image):
|
| 159 |
-
|
| 160 |
|
| 161 |
-
mask = process_big_images(
|
| 162 |
mask_colorized = colorize(mask)
|
| 163 |
fig = image_with_mask(img, mask)
|
| 164 |
|
|
|
|
| 118 |
outputs = segment(Image.fromarray(img))
|
| 119 |
msk = post_processing(outputs, target_size)
|
| 120 |
|
| 121 |
+
return img, Mask(msk)
|
| 122 |
|
| 123 |
|
| 124 |
def image_with_mask(
|
|
|
|
| 156 |
|
| 157 |
|
| 158 |
def main(image):
|
| 159 |
+
image = Image.fromarray(image)
|
| 160 |
|
| 161 |
+
img, mask = process_big_images(image)
|
| 162 |
mask_colorized = colorize(mask)
|
| 163 |
fig = image_with_mask(img, mask)
|
| 164 |
|