Function to start add mask mode. 1. Preprocess mask info from last state 2. Change editing state to add_mask 3. Set curr image with points and mask
(global_state, image)
| 729 | |
| 730 | # Image |
| 731 | def on_click_enable_draw(global_state, image): |
| 732 | """Function to start add mask mode. |
| 733 | 1. Preprocess mask info from last state |
| 734 | 2. Change editing state to add_mask |
| 735 | 3. Set curr image with points and mask |
| 736 | """ |
| 737 | global_state = preprocess_mask_info(global_state, image) |
| 738 | global_state['editing_state'] = 'add_mask' |
| 739 | image_raw = global_state['images']['image_raw'] |
| 740 | image_draw = update_image_draw(image_raw, global_state['points'], |
| 741 | global_state['mask'], True, |
| 742 | global_state) |
| 743 | return (global_state, |
| 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. |
nothing calls this directly
no test coverage detected