MCPcopy Create free account
hub / github.com/ChenhongyiYang/QueryDet-PyTorch / __init__

Method __init__

utils/loop_matcher.py:7–21  ·  view source on GitHub ↗
(
        self, thresholds: List[float], labels: List[int], allow_low_quality_matches: bool = False
    )

Source from the content-addressed store, hash-verified

5# useful when there are huge number of gt boxes
6class LoopMatcher(object):
7 def __init__(
8 self, thresholds: List[float], labels: List[int], allow_low_quality_matches: bool = False
9 ):
10 thresholds = thresholds[:]
11 assert thresholds[0] > 0
12 thresholds.insert(0, -float("inf"))
13 thresholds.append(float("inf"))
14 assert all(low <= high for (low, high) in zip(thresholds[:-1], thresholds[1:]))
15 assert all(l in [-1, 0, 1] for l in labels)
16 assert len(labels) == len(thresholds) - 1
17
18 self.low_quality_thrshold = 0.3
19 self.thresholds = thresholds
20 self.labels = labels
21 self.allow_low_quality_matches = allow_low_quality_matches
22
23
24 def _iou(self, boxes, box):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected