Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
awkrail committed Sep 19, 2024
1 parent 9062b7a commit d7c4707
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import math
import pytest
import subprocess
import random
from lighthouse.models import (MomentDETRPredictor, QDDETRPredictor, EaTRPredictor,
CGDETRPredictor, UVCOMPredictor)

Expand All @@ -12,6 +13,7 @@
MIN_DURATION = 10
MAX_DURATION = 151
MOMENT_NUM = 10
SAMPLE_NUM = 10


@pytest.mark.dependency()
Expand Down Expand Up @@ -78,8 +80,9 @@ def test_model_prediction():
slowfast_path='tests/SLOWFAST_8x8_R50.pkl',
pann_path='tests/Cnn14_mAP=0.431.pth')

# test model on 10s to 150s
for second in range(MIN_DURATION, MAX_DURATION):
# test 10 duration samples
durations = random.sample([i for i in range(MIN_DURATION, MAX_DURATION)], SAMPLE_NUM)
for second in durations:
video_path = f'tests/test_videos/video_duration_{second}.mp4'
model.encode_video(video_path)
query = 'A woman wearing a glass is speaking in front of the camera'
Expand Down

0 comments on commit d7c4707

Please sign in to comment.