Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove reference_video_tensor() fixture #62

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions test/samplers/video_clip_sampler_test.py
Original file line number Diff line number Diff line change
@@ -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(
@@ -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):
6 changes: 0 additions & 6 deletions test/test_utils.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
from dataclasses import dataclass

import numpy as np
import pytest

import torch

@@ -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
Loading