Update app.py
Browse files
app.py
CHANGED
|
@@ -261,6 +261,28 @@ with gr.Blocks(theme='pikto/theme@>=0.0.1,<0.0.3') as pan:
|
|
| 261 |
mask_img = gr.Image(type="pil", label="Image Mask", visible=False)
|
| 262 |
gr.ClearButton(components=[input_img, output_img, mask_img])
|
| 263 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
|
| 265 |
|
| 266 |
# text_input = gr.Textbox() ## Diffuser
|
|
|
|
| 261 |
mask_img = gr.Image(type="pil", label="Image Mask", visible=False)
|
| 262 |
gr.ClearButton(components=[input_img, output_img, mask_img])
|
| 263 |
|
| 264 |
+
chk_include_matting.change(change_include_matting, inputs=[chk_include_matting],
|
| 265 |
+
outputs=[slider_matting, matting_state,
|
| 266 |
+
slr_fg_threshold, slr_bg_threshold, slr_erode_size])
|
| 267 |
+
|
| 268 |
+
slr_bg_threshold.change(change_background_threshold, inputs=[slr_bg_threshold, matting_state],
|
| 269 |
+
outputs=[matting_state])
|
| 270 |
+
|
| 271 |
+
slr_erode_size.change(change_erode_size, inputs=[slr_erode_size, matting_state],
|
| 272 |
+
outputs=[matting_state])
|
| 273 |
+
|
| 274 |
+
chk_show_mask.change(change_show_mask, inputs=[chk_show_mask], outputs=[mask_img])
|
| 275 |
+
|
| 276 |
+
chk_change_color.change(change_background_mode, inputs=[chk_change_color],
|
| 277 |
+
outputs=[pkr_color, chk_dominant])
|
| 278 |
+
|
| 279 |
+
pkr_color.change(change_picker_color, inputs=[pkr_color, chk_dominant], outputs=[color_state])
|
| 280 |
+
|
| 281 |
+
chk_dominant.change(set_dominant_color, inputs=[chk_dominant], outputs=[color_state, pkr_color])
|
| 282 |
+
|
| 283 |
+
run_btn.click(predict, inputs=[input_img, drp_models, chk_smoot_mask, matting_state, color_state],
|
| 284 |
+
outputs=[output_img, mask_img])
|
| 285 |
+
|
| 286 |
|
| 287 |
|
| 288 |
# text_input = gr.Textbox() ## Diffuser
|