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

Function on_click

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

Source from the content-addressed store, hash-verified

63
64
65def on_click(image, target_point, points, size, evt: gr.SelectData):
66 if target_point:
67 points['target'].append([evt.index[1], evt.index[0]])
68 image = add_points_to_image(image, points, size=SIZE_TO_CLICK_SIZE[size])
69 return image, not target_point
70 points['handle'].append([evt.index[1], evt.index[0]])
71 image = add_points_to_image(image, points, size=SIZE_TO_CLICK_SIZE[size])
72 return image, not target_point
73
74
75def 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