Skip to content

Commit

Permalink
Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
briemla committed Oct 1, 2024
1 parent 85b8622 commit 5cb6bd9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/detect/detect_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,15 @@ def test_detection_in_rotated_video(
normal_counts = self._get_detection_counts_for(cyclist_mp4, yolov8m)
deviation = 0.05
for key in [CAR, PERSON, BICYCLE]:
assert rotated_counts[key] >= normal_counts[key] * (1 - deviation)
assert rotated_counts[key] <= normal_counts[key] * (1 + deviation)
assert (
normal_counts[key] * (1 - deviation)
<= rotated_counts[key]
<= normal_counts[key] * (1 + deviation)
), (
f"Failed class: {key}, "
f"normal counts: {normal_counts[key]}, "
f"rotated counts: {rotated_counts[key]}"
)

def _get_detection_counts_for(
self, converted_video: Path, yolov8m: Yolov8
Expand Down

0 comments on commit 5cb6bd9

Please sign in to comment.