ruminasval commited on
Commit
e925709
·
verified ·
1 Parent(s): 7739f9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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
- upload_button = gr.Button("Unggah Gambar")
160
- clear_button = gr.Button("Ganti")
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
- upload_button.click(predict, inputs=image_input, outputs=[detected_shape, explanation_output, recommendation_gallery])
167
- clear_button.click(lambda: (None, "", []), inputs=None, outputs=[image_input, detected_shape, recommendation_gallery])
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()