def test_rtree_iou_matrix(self):
     matcher_poly = MatchEngineIoU(0.1, 'coco')
     matcher_bbox = MatchEngineIoU(0.1, 'coco')
     iou_poly = matcher_poly.compute_similarity_matrix(
         detections_corr_poly, gt_corr_poly, label_mean_area=gt_mean_area)
     iou_bbox = matcher_bbox.compute_similarity_matrix(
         detections_bbox, gt_bbox, label_mean_area=gt_mean_area)
     print(iou_poly)
     print(iou_bbox)
     assert np.all(iou_poly == iou_bbox)
 def test_rtree_iou_matrix(self):
     matcher = MatchEngineIoU(0.1, 'coco')
     ref_iou = naive_compute_iou_matrix(sort_detection_by_confidence(detections), gt)
     iou = matcher.compute_similarity_matrix(detections, gt)
     print(iou)
     print(ref_iou)
     assert np.all(iou == ref_iou)
 def test_rtree_iou_matrix(self):
     matcher = MatchEngineIoU(0.1, 'coco')
     ref_iou = naive_compute_iou_matrix(sort_detection_by_confidence(detections), gt) * \
         (gt_mean_area / area(gt[:, 0]))
     iou = matcher.compute_similarity_matrix(detections, gt, label_mean_area=gt_mean_area)
     print(iou)
     print(ref_iou)
     assert np.all(iou[np.logical_not(np.isinf(iou))] == ref_iou[np.logical_not(np.isinf(iou))])