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

Function on_click

gradio_app.py:60–67  ·  view source on GitHub ↗
(image, target_point, points, size, evt: gr.SelectData)

Source from the content-addressed store, hash-verified

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