Skip to content

Commit

Permalink
Use correct video length
Browse files Browse the repository at this point in the history
  • Loading branch information
briemla committed Oct 25, 2024
1 parent 894ea3c commit ab174e2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/detect/detect_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from OTVision.detect.yolo import Yolov8, loadmodel
from tests.conftest import YieldFixture

CYCLIST_VIDEO_LENGTH = timedelta(seconds=3)
DEVIATION = 0.22
BICYCLE_UPPER_LIMIT = int(60 * (1 + DEVIATION))
PERSON_UPPER_LIMIT = int(120 * (1 + DEVIATION))
Expand Down Expand Up @@ -405,7 +406,9 @@ def test_detect_overwrite(
def test_detect_fulfill_minimum_detection_requirements(
self, yolov8m: Yolov8, cyclist_mp4: Path
) -> None:
class_counts = self._get_detection_counts_for(cyclist_mp4, yolov8m)
class_counts = self._get_detection_counts_for(
cyclist_mp4, yolov8m, CYCLIST_VIDEO_LENGTH
)

assert class_counts[CAR] >= CAR_LOWER_LIMIT
assert class_counts[PERSON] >= PERSON_LOWER_LIMIT
Expand All @@ -422,9 +425,8 @@ def test_detection_in_rotated_video(
test_data_dir: Path,
test_data_tmp_dir: Path,
) -> None:
video_length = timedelta(seconds=3)
rotated_counts = self._get_detection_counts_for(
rotated_cyclist_mp4, yolov8m, video_length
rotated_cyclist_mp4, yolov8m, CYCLIST_VIDEO_LENGTH
)

assert rotated_counts[CAR] >= CAR_LOWER_LIMIT
Expand Down

0 comments on commit ab174e2

Please sign in to comment.