def test_one_inaccurate_box(self): mean_avg_prec = mean_average_precision( self.t4_preds, self.t4_targets, iou_threshold=0.5, box_format="midpoint", num_classes=1, ) self.assertTrue( abs(self.t4_correct_mAP - mean_avg_prec) < self.epsilon)
def test_all_wrong_class(self): mean_avg_prec = mean_average_precision( self.t3_preds, self.t3_targets, iou_threshold=0.5, box_format="midpoint", num_classes=2, ) self.assertTrue( abs(self.t3_correct_mAP - mean_avg_prec) < self.epsilon)