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

Function is_inside

agents/ui_agent/util/utils.py:201–205  ·  view source on GitHub ↗
(box1, box2)

Source from the content-addressed store, hash-verified

199 return max(intersection / union, ratio1, ratio2)
200
201 def is_inside(box1, box2):
202 # return box1[0] >= box2[0] and box1[1] >= box2[1] and box1[2] <= box2[2] and box1[3] <= box2[3]
203 intersection = intersection_area(box1, box2)
204 ratio1 = intersection / box_area(box1)
205 return ratio1 > 0.95
206
207 boxes = boxes.tolist()
208 filtered_boxes = []

Callers 2

remove_overlapFunction · 0.85
remove_overlap_newFunction · 0.85

Calls 2

intersection_areaFunction · 0.70
box_areaFunction · 0.70

Tested by

no test coverage detected