def test_multi_hit(): detection_score = score_detection(ground_truth=[(0, 0), (0, 0.5), (0, -0.5)], predictions=[(0.0, 0.0)]) assert detection_score.false_positives == 0 assert detection_score.true_positives == 1 assert detection_score.false_negatives == 2 detection_score = score_detection( ground_truth=[(0, 0), (0, 0.5), (0, -0.5)], predictions=[(0.0, 0.0), (0.0, 0.0)], ) assert detection_score.false_positives == 0 assert detection_score.true_positives == 2 assert detection_score.false_negatives == 1
def test_point_merging(): predictions = load_points_csv("resources/points/predictions.csv") ground_truth = load_points_csv("resources/points/reference.csv") perfect_detection = score_detection(ground_truth=ground_truth, predictions=ground_truth) assert perfect_detection.true_positives == len(ground_truth) assert perfect_detection.false_positives == 0 assert perfect_detection.false_negatives == 0 detection_score = score_detection(ground_truth=ground_truth, predictions=predictions) assert detection_score.true_positives == 13 assert detection_score.false_positives == 1452 assert detection_score.false_negatives == 551
def test_score_detection(): detection_score = score_detection(ground_truth=targets, predictions=preds) assert detection_score.false_negatives == 2 assert detection_score.true_positives == 2 assert detection_score.false_positives == 3