Spaces:
Runtime error
Runtime error
Martin Tomov
commited on
async def
Browse files
app.py
CHANGED
|
@@ -235,7 +235,7 @@ with gr.Blocks() as demo:
|
|
| 235 |
json_output = gr.Textbox()
|
| 236 |
crops_output = gr.Gallery(label="Cropped Bounding Boxes")
|
| 237 |
|
| 238 |
-
def update_outputs(image, include_json, include_bboxes):
|
| 239 |
results = process_image(image, include_json, include_bboxes)
|
| 240 |
if include_bboxes and include_json:
|
| 241 |
annotated_img, *crops, json_txt = results
|
|
@@ -247,7 +247,7 @@ with gr.Blocks() as demo:
|
|
| 247 |
annotated_img, json_txt = results
|
| 248 |
return (annotated_img, json_txt, [])
|
| 249 |
else:
|
| 250 |
-
annotated_img
|
| 251 |
return (annotated_img, None, [])
|
| 252 |
|
| 253 |
submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
|
|
|
|
| 235 |
json_output = gr.Textbox()
|
| 236 |
crops_output = gr.Gallery(label="Cropped Bounding Boxes")
|
| 237 |
|
| 238 |
+
async def update_outputs(image, include_json, include_bboxes):
|
| 239 |
results = process_image(image, include_json, include_bboxes)
|
| 240 |
if include_bboxes and include_json:
|
| 241 |
annotated_img, *crops, json_txt = results
|
|
|
|
| 247 |
annotated_img, json_txt = results
|
| 248 |
return (annotated_img, json_txt, [])
|
| 249 |
else:
|
| 250 |
+
annotated_img = results[0]
|
| 251 |
return (annotated_img, None, [])
|
| 252 |
|
| 253 |
submit_button.click(update_outputs, [image_input, include_json, include_bboxes], [annotated_output, json_output, crops_output])
|