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

Function get_center_distance

eval/utils/evaluator.py:88–92  ·  view source on GitHub ↗
(box)

Source from the content-addressed store, hash-verified

86 return []
87 else:
88 def get_center_distance(box):
89 ymin, xmin, h, w = box
90 center_y = ymin + h/2
91 center_x = xmin + w/2
92 return ((center_y - y) ** 2 + (center_x - x) ** 2) ** 0.5
93
94 sorted_boxes = sorted(bbox_list, key=get_center_distance)
95 # return the 5 nearest bboxes

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected