Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -156,15 +156,15 @@ with gr.Blocks(theme=gr.themes.Soft()) as iface:
|
|
| 156 |
with gr.Row():
|
| 157 |
with gr.Column():
|
| 158 |
image_input = gr.Image(type="pil")
|
| 159 |
-
|
| 160 |
-
|
| 161 |
with gr.Column():
|
| 162 |
detected_shape = gr.Textbox(label="Bentuk Wajah Terdeteksi")
|
| 163 |
explanation_output = gr.Textbox(label="Penjelasan")
|
| 164 |
recommendation_gallery = gr.Gallery(label="Rekomendasi Kacamata", columns=3, show_label=False)
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
| 168 |
|
| 169 |
if __name__ == "__main__":
|
| 170 |
iface.launch()
|
|
|
|
| 156 |
with gr.Row():
|
| 157 |
with gr.Column():
|
| 158 |
image_input = gr.Image(type="pil")
|
| 159 |
+
confirm_button = gr.Button("Konfirmasi")
|
| 160 |
+
restart_button = gr.Button("Restart")
|
| 161 |
with gr.Column():
|
| 162 |
detected_shape = gr.Textbox(label="Bentuk Wajah Terdeteksi")
|
| 163 |
explanation_output = gr.Textbox(label="Penjelasan")
|
| 164 |
recommendation_gallery = gr.Gallery(label="Rekomendasi Kacamata", columns=3, show_label=False)
|
| 165 |
|
| 166 |
+
confirm_button.click(predict, inputs=image_input, outputs=[detected_shape, explanation_output, recommendation_gallery])
|
| 167 |
+
restart_button.click(lambda: (None, "", [], []), inputs=None, outputs=[image_input, detected_shape, explanation_output, recommendation_gallery])
|
| 168 |
|
| 169 |
if __name__ == "__main__":
|
| 170 |
iface.launch()
|