MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / check_inside

Function check_inside

eval/utils/evaluator.py:59–73  ·  view source on GitHub ↗
(x, y, bbox_list)

Source from the content-addressed store, hash-verified

57
58
59def check_inside(x, y, bbox_list):
60 bbox_array = np.array(bbox_list)
61 y_min, x_min, height, width = bbox_array[:, 0], bbox_array[:, 1], bbox_array[:, 2], bbox_array[:, 3]
62 y_max, x_max = y_min + height, x_min + width
63
64 # Check whether (x, y) is inside any of the bounding boxes
65 within_x = (x_min <= x) & (x <= x_max)
66 within_y = (y_min <= y) & (y <= y_max)
67 within_bbox = within_x & within_y
68
69 if np.any(within_bbox):
70 within_bbox_coords = bbox_array[within_bbox]
71 return True, within_bbox_coords
72 else:
73 return False, None
74
75
76def obtain_gt_bbox(coordinate, bbox_list, eval_android_control=False):

Callers 1

obtain_gt_bboxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected