Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,10 +47,17 @@ with gr.Blocks() as demo:
|
|
| 47 |
|
| 48 |
submit_btn = gr.Button("Submit")
|
| 49 |
feedback_btn = gr.Button("The model was wrong")
|
|
|
|
| 50 |
|
| 51 |
submit_btn.click(predict, inputs=image_input, outputs=[prediction_output, confidence_output])
|
| 52 |
feedback_btn.click(report_feedback, outputs=feedback_output)
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
# Launch the Gradio interface
|
| 55 |
if __name__ == "__main__":
|
| 56 |
demo.launch(share=True)
|
|
|
|
| 47 |
|
| 48 |
submit_btn = gr.Button("Submit")
|
| 49 |
feedback_btn = gr.Button("The model was wrong")
|
| 50 |
+
clear_btn = gr.Button("Clear")
|
| 51 |
|
| 52 |
submit_btn.click(predict, inputs=image_input, outputs=[prediction_output, confidence_output])
|
| 53 |
feedback_btn.click(report_feedback, outputs=feedback_output)
|
| 54 |
|
| 55 |
+
# Clear button logic
|
| 56 |
+
def clear_all():
|
| 57 |
+
return None, "", ""
|
| 58 |
+
|
| 59 |
+
clear_btn.click(clear_all, outputs=[image_input, prediction_output, confidence_output])
|
| 60 |
+
|
| 61 |
# Launch the Gradio interface
|
| 62 |
if __name__ == "__main__":
|
| 63 |
demo.launch(share=True)
|