MCPcopy
hub / github.com/dbolya/yolact / intersect

Function intersect

scripts/augment_bbox.py:91–95  ·  view source on GitHub ↗
(box_a, box_b)

Source from the content-addressed store, hash-verified

89)
90
91def intersect(box_a, box_b):
92 max_xy = np.minimum(box_a[:, 2:], box_b[2:])
93 min_xy = np.maximum(box_a[:, :2], box_b[:2])
94 inter = np.clip((max_xy - min_xy), a_min=0, a_max=np.inf)
95 return inter[:, 0] * inter[:, 1]
96
97
98def jaccard_numpy(box_a, box_b):

Callers 1

jaccard_numpyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected