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

Function update_image_draw

visualizer_drag_gradio.py:102–112  ·  view source on GitHub ↗
(image, points, mask, show_mask, global_state=None)

Source from the content-addressed store, hash-verified

100
101
102def update_image_draw(image, points, mask, show_mask, global_state=None):
103
104 image_draw = draw_points_on_image(image, points)
105 if show_mask and mask is not None and not (mask == 0).all() and not (
106 mask == 1).all():
107 image_draw = draw_mask_on_image(image_draw, mask)
108
109 image_draw = Image.fromarray(add_watermark_np(np.array(image_draw)))
110 if global_state is not None:
111 global_state['images']['image_show'] = image_draw
112 return image_draw
113
114
115def preprocess_mask_info(global_state, image):

Callers 8

on_click_startFunction · 0.85
on_click_reset_maskFunction · 0.85
on_click_enable_drawFunction · 0.85
on_click_remove_drawFunction · 0.85
on_click_add_pointFunction · 0.85
on_click_imageFunction · 0.85
on_click_clear_pointsFunction · 0.85
on_click_show_maskFunction · 0.85

Calls 3

draw_points_on_imageFunction · 0.90
draw_mask_on_imageFunction · 0.90
add_watermark_npFunction · 0.90

Tested by

no test coverage detected