MCPcopy
hub / github.com/microsoft/Magma / pred_2_point

Function pred_2_point

agents/ui_agent/util/process_utils.py:27–34  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

25
26# point (str) -> point
27def pred_2_point(s):
28 floats = re.findall(r'-?\d+\.?\d*', s)
29 floats = [float(num) for num in floats]
30 if len(floats) == 2:
31 click_point = floats
32 elif len(floats) == 4:
33 click_point = [(floats[0]+floats[2])/2, (floats[1]+floats[3])/2]
34 return click_point
35
36# bbox (qwen str) -> bbox
37def extract_bbox(s):

Callers 1

processFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected