Spaces:
Sleeping
Sleeping
Update app_gradio.py
Browse files- app_gradio.py +2 -1
app_gradio.py
CHANGED
@@ -366,7 +366,8 @@ with gr.Blocks(css=css, title='Fast Segment Anything') as demo:
|
|
366 |
def clear_text():
|
367 |
return None, None, None
|
368 |
|
369 |
-
cond_img_p.
|
|
|
370 |
clear_btn_e.click(clear, outputs=[cond_img_e, segm_img_e])
|
371 |
clear_btn_p.click(clear, outputs=[cond_img_p, segm_img_p])
|
372 |
clear_btn_t.click(clear_text, outputs=[cond_img_p, segm_img_p, text_box])
|
|
|
366 |
def clear_text():
|
367 |
return None, None, None
|
368 |
|
369 |
+
cond_img_p.clear(clear, outputs=[cond_img_e, segm_img_e]) # reset when input image is cleared
|
370 |
+
cond_img_p.input(clear, outputs=[cond_img_e, segm_img_e]) # reset when input image is changed
|
371 |
clear_btn_e.click(clear, outputs=[cond_img_e, segm_img_e])
|
372 |
clear_btn_p.click(clear, outputs=[cond_img_p, segm_img_p])
|
373 |
clear_btn_t.click(clear_text, outputs=[cond_img_p, segm_img_p, text_box])
|