コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
ファイル: test_utils.py プロジェクト: sjoerdk/evalutils
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