Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -74,11 +74,14 @@ def process_input_image(image_source, download_masks=False):
|
|
| 74 |
|
| 75 |
mask_zip, output_name = create_mask_zip(predicted_image)
|
| 76 |
if download_masks:
|
|
|
|
| 77 |
return "Predicted Masked Image", rgb_image, mask_zip, output_name
|
| 78 |
else:
|
|
|
|
| 79 |
return "Predicted Masked Image", rgb_image, None, None
|
| 80 |
|
| 81 |
|
|
|
|
| 82 |
my_app = gr.Blocks()
|
| 83 |
|
| 84 |
|
|
@@ -150,7 +153,6 @@ with my_app:
|
|
| 150 |
output_label,
|
| 151 |
img_output,
|
| 152 |
masks_zip,
|
| 153 |
-
]
|
| 154 |
-
show_hidden_outputs=True
|
| 155 |
)
|
| 156 |
my_app.launch(debug=True)
|
|
|
|
| 74 |
|
| 75 |
mask_zip, output_name = create_mask_zip(predicted_image)
|
| 76 |
if download_masks:
|
| 77 |
+
masks_zip.set_attributes(label="Download Masks", filename="masks.zip", hidden=False)
|
| 78 |
return "Predicted Masked Image", rgb_image, mask_zip, output_name
|
| 79 |
else:
|
| 80 |
+
masks_zip.set_attributes(hidden=True)
|
| 81 |
return "Predicted Masked Image", rgb_image, None, None
|
| 82 |
|
| 83 |
|
| 84 |
+
|
| 85 |
my_app = gr.Blocks()
|
| 86 |
|
| 87 |
|
|
|
|
| 153 |
output_label,
|
| 154 |
img_output,
|
| 155 |
masks_zip,
|
| 156 |
+
]
|
|
|
|
| 157 |
)
|
| 158 |
my_app.launch(debug=True)
|