Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
potipot committed Oct 7, 2023
1 parent 695aaa4 commit d7429f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
File renamed without changes.
Binary file added tests/metrics/expected_register_t2p.pkl
Binary file not shown.
11 changes: 9 additions & 2 deletions tests/metrics/test_confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,16 @@ def test_pairwise_iou_matching(target, prediction):
assert torch.allclose(result, expected_result, atol=1e-4)


def test_match_prediction(target, prediction):
def test_match_prediction_to_target(target, prediction):
result = match_predictions_to_targets(target, prediction, iou_threshold=0.5)
with open(Path(__file__).parent / "expected_register.pkl", mode="rb") as infile:
with open(Path(__file__).parent / "expected_register_p2t.pkl", mode="rb") as infile:
expected_result = pickle.load(infile)
assert result == expected_result


def test_match_target_to_prediction(target, prediction):
result = match_targets_to_predictions(target, prediction, iou_threshold=0.5)
with open(Path(__file__).parent / "expected_register_t2p.pkl", mode="rb") as infile:
expected_result = pickle.load(infile)
assert result == expected_result

Expand Down

0 comments on commit d7429f6

Please sign in to comment.