Skip to content

Commit 86c8a4f

Browse files
committed
Test sequential and random frames
1 parent e4a6ceb commit 86c8a4f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

benchmarks/decoders/benchmark_decoders.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def main() -> None:
136136

137137
if args.verify_outputs:
138138
verify_outputs(decoders_to_run, video_paths, num_uniform_samples)
139-
return
140139

141140
results = run_benchmarks(
142141
decoders_to_run,

benchmarks/decoders/benchmark_decoders_library.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,12 +1031,18 @@ def verify_outputs(decoders_to_run, video_paths, num_samples):
10311031
# Import library to show frames that don't match
10321032
from tensorcat import tensorcat
10331033

1034-
# Create TorchCodecPublic decoder to use as a baseline
1035-
torchcodec_display_name = decoder_registry["torchcodec_public"].display_name
1036-
options = decoder_registry["torchcodec_public"].default_options
1037-
kind = decoder_registry["torchcodec_public"].kind
1038-
torchcodec_public_decoder = kind(**options)
1039-
1034+
# Reuse TorchCodecPublic decoder with options, if provided, as the baseline
1035+
if torchcodec_display_name := next(
1036+
(name for name in decoders_to_run if "TorchCodecPublic" in name),
1037+
None,
1038+
):
1039+
torchcodec_public_decoder = decoders_to_run[torchcodec_display_name]
1040+
# Create default TorchCodecPublic decoder to use as a baseline
1041+
else:
1042+
torchcodec_display_name = decoder_registry["torchcodec_public"].display_name
1043+
options = decoder_registry["torchcodec_public"].default_options
1044+
kind = decoder_registry["torchcodec_public"].kind
1045+
torchcodec_public_decoder = kind(**options)
10401046
# Get frames using each decoder
10411047
for video_file_path in video_paths:
10421048
metadata = get_metadata(video_file_path)

0 commit comments

Comments
 (0)