MCPcopy
hub / github.com/XingangPan/DragGAN / on_click_remove_draw

Function on_click_remove_draw

visualizer_drag_gradio.py:746–759  ·  view source on GitHub ↗

Function to start remove mask mode. 1. Preprocess mask info from last state 2. Change editing state to remove_mask 3. Set curr image with points and mask

(global_state, image)

Source from the content-addressed store, hash-verified

744 gr.Image.update(value=image_draw, interactive=True))
745
746 def on_click_remove_draw(global_state, image):
747 """Function to start remove mask mode.
748 1. Preprocess mask info from last state
749 2. Change editing state to remove_mask
750 3. Set curr image with points and mask
751 """
752 global_state = preprocess_mask_info(global_state, image)
753 global_state['edinting_state'] = 'remove_mask'
754 image_raw = global_state['images']['image_raw']
755 image_draw = update_image_draw(image_raw, global_state['points'],
756 global_state['mask'], True,
757 global_state)
758 return (global_state,
759 gr.Image.update(value=image_draw, interactive=True))
760
761 enable_add_mask.click(on_click_enable_draw,
762 inputs=[global_state, form_image],

Callers

nothing calls this directly

Calls 3

preprocess_mask_infoFunction · 0.85
update_image_drawFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected