def test_match_xview_at_01(self):
     matcher_poly = MatchEngineIoU(0.1, 'xview')
     matcher_bbox = MatchEngineIoU(0.1, 'xview')
     assert \
         np.all(matcher_bbox.match(detections_bbox,
                                   gt_bbox,
                                   label_mean_area=gt_mean_area) == matcher_poly.match(detections_poly,
                                                                                       gt_poly,
                                                                                       label_mean_area=gt_mean_area))
 def test_match_coco_at_005(self):
     matcher_poly = MatchEngineIoU(0.05, 'coco')
     matcher_bbox = MatchEngineIoU(0.05, 'coco')
     assert \
         np.all(matcher_bbox.match(detections_bbox,
                                   gt_bbox,
                                   label_mean_area=gt_mean_area) == matcher_poly.match(detections_poly,
                                                                                       gt_poly,
                                                                                       label_mean_area=gt_mean_area))
 def test_match_xview_at_01(self):
     matcher = MatchEngineIoU(0.1, 'xview')
     assert np.all(
         matcher.match(detections, gt) == np.array(
             [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0],
              [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0]]))
 def test_match_coco_at_005(self):
     matcher = MatchEngineIoU(0.05, 'coco')
     assert np.all(
         matcher.match(detections, gt) == np.array(
             [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0],
              [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0],
              [0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0]]))
 def test_match_non_unitary_at_01(self):
     matcher = MatchEngineIoU(0.1, 'non-unitary')
     assert np.all(
         matcher.match(detections, gt) == np.array(
             [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 1, 0],
              [0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0],
              [0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0]]))
 def test_match_xview_at_005(self):
     matcher = MatchEngineIoU(0.05, 'xview')
     assert np.all(
         matcher.match(detections, gt, label_mean_area=gt_mean_area) == np.
         array([[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0],
                [0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0],
                [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]))
 def test_match_coco_at_01(self):
     matcher = MatchEngineIoU(0.1, 'coco')
     assert np.all(
         matcher.match(detections, gt, label_mean_area=gt_mean_area) == np.
         array([[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 1, 0],
                [0, 0, 0, 1, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0],
                [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]))
 def test_match_xview_at_01(self):
     matcher_poly = MatchEngineIoU(0.1, 'xview')
     matcher_bbox = MatchEngineIoU(0.1, 'xview')
     assert np.all(
         matcher_bbox.match(detections_bbox, gt_bbox) == matcher_poly.match(
             detections_poly, gt_poly))
 def test_match_coco_at_005(self):
     matcher_poly = MatchEngineIoU(0.05, 'coco')
     matcher_bbox = MatchEngineIoU(0.05, 'coco')
     assert np.all(
         matcher_bbox.match(detections_bbox, gt_bbox) == matcher_poly.match(
             detections_poly, gt_poly))
예제 #10
0
 def test_match_non_unitary_at_01(self):
     matcher_poly = MatchEngineIoU(0.1, 'non-unitary')
     matcher_bbox = MatchEngineIoU(0.1, 'non-unitary')
     assert np.all(
         matcher_bbox.match(detections_bbox, gt_bbox) == matcher_poly.match(
             detections_poly, gt_poly))
예제 #11
0
 def _make_scale_match(self, threshold, method):
     matcher = MatchEngineIoU(threshold, method)
     matcher.match(self.data_detect_conv,
                   self.data_detect_conv[:, (True, False, True)])