MCPcopy Create free account
hub / github.com/Tencent/ObjectDetection-OneStageDet / iou

Function iou

brambox/boxes/statistics/util.py:12–28  ·  view source on GitHub ↗

Compute the intersection over union between two boxes. The function returns the ``IUO``, which is defined as: :math:`IOU = \\frac { {intersection}(a, b) } { {union}(a, b) }` Args: a (brambox.boxes.box.Box): First bounding box b (brambox.boxes.box.Box): Second bounding

(a, b)

Source from the content-addressed store, hash-verified

10
11
12def iou(a, b):
13 """ Compute the intersection over union between two boxes.
14 The function returns the ``IUO``, which is defined as:
15
16 :math:`IOU = \\frac { {intersection}(a, b) } { {union}(a, b) }`
17
18 Args:
19 a (brambox.boxes.box.Box): First bounding box
20 b (brambox.boxes.box.Box): Second bounding box
21
22 Returns:
23 Number: Intersection over union
24 """
25 intersection_area = intersection(a, b)
26 union_area = a.width * a.height + b.width * b.height - intersection_area
27
28 return intersection_area / union_area
29
30
31def ioa(a, b, denominator='b'):

Callers

nothing calls this directly

Calls 1

intersectionFunction · 0.85

Tested by

no test coverage detected