MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / intersection

Method intersection

PATH/core/solvers/utils/detools/box.py:100–113  ·  view source on GitHub ↗

:param boxB: the target bounding box to compute overlap :type boxB: BoxBase :return: the intersection area of current bounding box and boxB

(self, boxB)

Source from the content-addressed store, hash-verified

98 return numpy.array([self.x, self.y, self.x1, self.y1], dtype="float32")
99
100 def intersection(self, boxB):
101 """
102 :param boxB: the target bounding box to compute overlap
103 :type boxB: BoxBase
104 :return: the intersection area of current bounding box and boxB
105 """
106 s1 = (self.y1 - self.y) * (self.x1 - self.x)
107 s2 = (boxB.y1 - boxB.y) * (boxB.x1 - boxB.x)
108 s0 = 0.0 #intersection area
109 if not(self.x >= boxB.x1 or boxB.x >= self.x1 or self.y >= boxB.y1 or boxB.y >= self.y1):
110 x = max(self.x, boxB.x); x1 = min(self.x1, boxB.x1)
111 y = max(self.y, boxB.y); y1 = min(self.y1, boxB.y1)
112 s0 = abs(x - x1) * abs(y - y1)
113 return float(s0)
114
115 def iou(self, boxB):
116 """

Callers 5

iouMethod · 0.95
ioaMethod · 0.95
iobMethod · 0.95
iominMethod · 0.95
apply_polygonsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected