Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -438,27 +438,27 @@ async def predict(image):
|
|
438 |
"html_output": html_output
|
439 |
}
|
440 |
return html_output, annotated_image, gr.update(visible=True, choices=all_buttons), initial_state
|
441 |
-
|
442 |
-
|
443 |
"dogs_info": ''.join(dogs_info),
|
444 |
"buttons": [],
|
445 |
"show_back": False,
|
446 |
"image": annotated_image,
|
447 |
"is_multi_dog": len(dogs) > 1,
|
448 |
"html_output": html_output
|
449 |
-
|
450 |
-
|
451 |
|
452 |
-
|
453 |
-
|
454 |
"dogs_info": dogs_info,
|
455 |
"buttons": [],
|
456 |
"show_back": False,
|
457 |
"image": annotated_image,
|
458 |
"is_multi_dog": len(dogs) > 1,
|
459 |
"html_output": html_output
|
460 |
-
|
461 |
-
|
462 |
|
463 |
except Exception as e:
|
464 |
error_msg = f"An error occurred: {str(e)}\n\nTraceback:\n{traceback.format_exc()}"
|
|
|
438 |
"html_output": html_output
|
439 |
}
|
440 |
return html_output, annotated_image, gr.update(visible=True, choices=all_buttons), initial_state
|
441 |
+
else:
|
442 |
+
initial_state = {
|
443 |
"dogs_info": ''.join(dogs_info),
|
444 |
"buttons": [],
|
445 |
"show_back": False,
|
446 |
"image": annotated_image,
|
447 |
"is_multi_dog": len(dogs) > 1,
|
448 |
"html_output": html_output
|
449 |
+
}
|
450 |
+
return html_output, annotated_image, gr.update(visible=False, choices=[]), initial_state
|
451 |
|
452 |
+
else:
|
453 |
+
initial_state = {
|
454 |
"dogs_info": dogs_info,
|
455 |
"buttons": [],
|
456 |
"show_back": False,
|
457 |
"image": annotated_image,
|
458 |
"is_multi_dog": len(dogs) > 1,
|
459 |
"html_output": html_output
|
460 |
+
}
|
461 |
+
return html_output, annotated_image, gr.update(visible=False, choices=[]), initial_state
|
462 |
|
463 |
except Exception as e:
|
464 |
error_msg = f"An error occurred: {str(e)}\n\nTraceback:\n{traceback.format_exc()}"
|