Skip to content

Commit

Permalink
Remove reference_video_tensor() fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Jul 8, 2024
1 parent b6c624e commit 3605326
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
12 changes: 3 additions & 9 deletions test/samplers/video_clip_sampler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
VideoClipSampler,
)

from ..test_utils import ( # noqa: F401; see use in test_sampler
assert_tensor_equal,
reference_video_tensor,
)
from ..test_utils import assert_tensor_equal, NASA_VIDEO


@pytest.mark.parametrize(
Expand All @@ -33,15 +30,12 @@
),
],
)
def test_sampler(
sampler_args,
reference_video_tensor, # noqa: F811; linter does not see this as a use
):
def test_sampler(sampler_args):
torch.manual_seed(0)
desired_width, desired_height = 320, 240
video_args = VideoArgs(desired_width=desired_width, desired_height=desired_height)
sampler = VideoClipSampler(video_args, sampler_args)
clips = sampler(reference_video_tensor)
clips = sampler(NASA_VIDEO.to_tensor())
assert_tensor_equal(len(clips), sampler_args.clips_per_video)
clip = clips[0]
if isinstance(sampler_args, TimeBasedSamplerArgs):
Expand Down
6 changes: 0 additions & 6 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from dataclasses import dataclass

import numpy as np
import pytest

import torch

Expand Down Expand Up @@ -36,11 +35,6 @@ def _load_tensor_from_file(filename: str) -> torch.Tensor:
return torch.load(file_path, weights_only=True)


@pytest.fixture()
def reference_video_tensor() -> torch.Tensor:
return NASA_VIDEO.to_tensor()


@dataclass
class TestContainerFile:
filename: str
Expand Down

0 comments on commit 3605326

Please sign in to comment.