Skip to content

Commit afc1647

Browse files
authored
Update thread counts for TorchCodec (#395)
1 parent eff34b9 commit afc1647

File tree

4 files changed

+194
-196
lines changed

4 files changed

+194
-196
lines changed

benchmarks/decoders/benchmark_decoders_library.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,7 @@ def get_consecutive_frames_from_video(self, video_file, numFramesToDecode):
258258

259259
class TorchCodecPublic(AbstractDecoder):
260260
def __init__(self, num_ffmpeg_threads=None, device="cpu"):
261-
self._num_ffmpeg_threads = (
262-
int(num_ffmpeg_threads) if num_ffmpeg_threads else None
263-
)
261+
self._num_ffmpeg_threads = int(num_ffmpeg_threads) if num_ffmpeg_threads else 1
264262
self._device = device
265263

266264
from torchvision.transforms import v2 as transforms_v2
@@ -628,7 +626,7 @@ def run_benchmarks(
628626
},
629627
label=f"video={video_file_path} {metadata_label}",
630628
sub_label=decoder_name,
631-
description=f"dataloader[threads={bp.num_threads} batch_size={bp.batch_size}] {num_samples} decode_and_transform()",
629+
description=f"dataloader[threads={bp.num_threads},batch_size={bp.batch_size}] {num_samples} decode_and_transform()",
632630
)
633631
results.append(
634632
dataloader_result.blocked_autorange(
@@ -673,7 +671,7 @@ def run_benchmarks(
673671
decoder_name,
674672
video_file_path,
675673
num_samples,
676-
f"{kind} seek()+next()",
674+
f"{num_samples} x {kind} seek()+next()",
677675
)
678676
)
679677

2.07 KB
Loading

0 commit comments

Comments
 (0)