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

Function intersection_area

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

Source from the content-addressed store, hash-verified

182 return (box[2] - box[0]) * (box[3] - box[1])
183
184 def intersection_area(box1, box2):
185 x1 = max(box1[0], box2[0])
186 y1 = max(box1[1], box2[1])
187 x2 = min(box1[2], box2[2])
188 y2 = min(box1[3], box2[3])
189 return max(0, x2 - x1) * max(0, y2 - y1)
190
191 def IoU(box1, box2):
192 intersection = intersection_area(box1, box2)

Callers 2

IoUFunction · 0.70
is_insideFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected