Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
awkrail committed Sep 14, 2024
1 parent 6f5cd62 commit 742259a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
with:
python-version: 3.9

- name: Run ffmpeg
run: |
apt update
apt upgrade
apt install -y ffmpeg
- name: Run dependency libraries
run: |
pip install torch==2.0.0 torchvision==0.15.1 torchaudio==2.0.1 torchtext==0.15.1
Expand Down
17 changes: 16 additions & 1 deletion tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
import subprocess

def test():
def generate_multiple_duration_videos():
MIN_DURATION = 10
MAX_DURATION = 151
durations = [i for i in range(MIN_DURATION, MAX_DURATION)]
for duration in durations:
cmd = 'ffmpeg -i api_example/RoripwjYFp8_60.0_210.0.mp4 -t {} -c copy tests/test_videos/video_duration_{}.mp4'.format(duration, duration)
subprocess.run(cmd, shell=True)
return True


def test_model_prediction():
features = ['resnet_glove', 'clip', 'clip_slowfast', 'clip_slowfast_pann']
models = ['moment_detr', 'qd_detr', 'eatr', 'cg_detr', 'uvcom', 'tr_detr', 'taskweave_mr2hd', 'taskweave_hd2mr']
datasets = ['qvhighlight']
# TODO: test all of the models on all of the settings.
return True

0 comments on commit 742259a

Please sign in to comment.