LPX55 commited on
Commit
ab596ee
·
1 Parent(s): c767877
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -569,13 +569,23 @@ with gr.Blocks(css=css, fill_height=True) as demo:
569
  with gr.Column():
570
  image_output = gr.Image(label="Segmented Image", type="pil", height=400)
571
 
 
 
 
 
 
 
 
 
 
 
572
  # Define the action triggered by the upload_image_input change
573
- upload_image_input.change(
574
- fn=update_mask,
575
- inputs=[upload_image_input],
576
- outputs=[image_output],
577
- show_progress=True,
578
- )
579
  with gr.TabItem("Misc"):
580
  with gr.Column():
581
  clear_cache_button = gr.Button("Clear CUDA Cache")
 
569
  with gr.Column():
570
  image_output = gr.Image(label="Segmented Image", type="pil", height=400)
571
 
572
+ # Button to trigger the prediction
573
+ predict_button = gr.Button("Predict Mask")
574
+
575
+ # Define the action triggered by the predict button
576
+ predict_button.click(
577
+ fn=predict_masks,
578
+ inputs=[upload_image_input],
579
+ outputs=[image_output],
580
+ show_progress=True,
581
+ )
582
  # Define the action triggered by the upload_image_input change
583
+ # upload_image_input.change(
584
+ # fn=update_mask,
585
+ # inputs=[upload_image_input],
586
+ # outputs=[image_output],
587
+ # show_progress=True,
588
+ # )
589
  with gr.TabItem("Misc"):
590
  with gr.Column():
591
  clear_cache_button = gr.Button("Clear CUDA Cache")