Spaces:
Running
on
Zero
Running
on
Zero
Martin Tomov
commited on
adjustments to outputs in new demo
Browse files
app.py
CHANGED
@@ -242,14 +242,18 @@ with gr.Blocks() as demo:
|
|
242 |
return (annotated_img, json_txt, crops)
|
243 |
elif include_bboxes:
|
244 |
annotated_img, *crops = results
|
245 |
-
|
|
|
246 |
elif include_json:
|
247 |
-
annotated_img, json_txt = results
|
248 |
-
|
|
|
249 |
else:
|
250 |
annotated_img = results[0]
|
251 |
-
|
|
|
|
|
252 |
|
253 |
submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
|
254 |
|
255 |
-
demo.launch()
|
|
|
242 |
return (annotated_img, json_txt, crops)
|
243 |
elif include_bboxes:
|
244 |
annotated_img, *crops = results
|
245 |
+
json_txt = None
|
246 |
+
return (annotated_img, json_txt, crops)
|
247 |
elif include_json:
|
248 |
+
annotated_img, json_txt = results[:2]
|
249 |
+
crops = []
|
250 |
+
return (annotated_img, json_txt, crops)
|
251 |
else:
|
252 |
annotated_img = results[0]
|
253 |
+
json_txt = None
|
254 |
+
crops = []
|
255 |
+
return (annotated_img, json_txt, crops)
|
256 |
|
257 |
submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
|
258 |
|
259 |
+
demo.launch(title="InsectSAM")
|