MCPcopy Create free account
hub / github.com/OpenGVLab/DragGAN / on_click

Function on_click

draggan/web.py:61–68  ·  view source on GitHub ↗
(image, target_point, points, size, evt: gr.SelectData)

Source from the content-addressed store, hash-verified

59
60
61def on_click(image, target_point, points, size, evt: gr.SelectData):
62 if target_point:
63 points['target'].append([evt.index[1], evt.index[0]])
64 image = add_points_to_image(image, points, size=SIZE_TO_CLICK_SIZE[size])
65 return image, not target_point
66 points['handle'].append([evt.index[1], evt.index[0]])
67 image = add_points_to_image(image, points, size=SIZE_TO_CLICK_SIZE[size])
68 return image, not target_point
69
70
71def on_drag(model, points, max_iters, state, size, mask, lr_box):

Callers

nothing calls this directly

Calls 1

add_points_to_imageFunction · 0.70

Tested by

no test coverage detected