Skip to content

Commit 868922c

Browse files
committed
Nit
1 parent 89b2b1d commit 868922c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/samplers/test_samplers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,29 +154,25 @@ def test_time_based_sampler(sampler, seconds_between_frames):
154154
partial(
155155
clips_at_regular_indices,
156156
num_clips=1,
157-
num_frames_per_clip=5,
158157
sampling_range_start=0,
159158
sampling_range_end=1,
160159
),
161160
partial(
162161
clips_at_random_indices,
163162
num_clips=1,
164-
num_frames_per_clip=5,
165163
sampling_range_start=0,
166164
sampling_range_end=1,
167165
),
168166
partial(
169167
clips_at_random_timestamps,
170168
num_clips=1,
171-
num_frames_per_clip=5,
172169
sampling_range_start=0,
173170
sampling_range_end=0.01,
174171
),
175172
partial(
176173
clips_at_regular_timestamps,
177174
seconds_between_clip_starts=1,
178-
seconds_between_frames=0.0335,
179-
num_frames_per_clip=5,
175+
seconds_between_frames=0.0335, # forces consecutive frames
180176
sampling_range_start=0,
181177
sampling_range_end=0.01,
182178
),
@@ -187,9 +183,13 @@ def test_against_ref(sampler):
187183
# video. We can then assert the exact frame values against our existing test
188184
# resource reference.
189185
decoder = VideoDecoder(NASA_VIDEO.path)
190-
expected_clip_data = NASA_VIDEO.get_frame_data_by_range(start=0, stop=5)
191186

192-
clip = sampler(decoder)[0]
187+
num_frames_per_clip = 5
188+
expected_clip_data = NASA_VIDEO.get_frame_data_by_range(
189+
start=0, stop=num_frames_per_clip
190+
)
191+
192+
clip = sampler(decoder, num_frames_per_clip=num_frames_per_clip)[0]
193193
assert_tensor_equal(clip.data, expected_clip_data)
194194

195195

0 commit comments

Comments
 (0)