From dcd0f5c5193e672ffedea32997b41ec81fef2e61 Mon Sep 17 00:00:00 2001 From: ChopinChen Date: Wed, 9 Apr 2025 15:00:35 +0800 Subject: [PATCH] add convert stats in parallel using multiple thread and decord video backend. --- lerobot/common/datasets/video_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lerobot/common/datasets/video_utils.py b/lerobot/common/datasets/video_utils.py index 1e790913..129a09b0 100644 --- a/lerobot/common/datasets/video_utils.py +++ b/lerobot/common/datasets/video_utils.py @@ -24,6 +24,7 @@ from pathlib import Path from typing import Any, ClassVar import decord +import numpy as np import pyarrow as pa import torch import torchvision @@ -249,7 +250,7 @@ def decode_video_frames_torchcodec( def decode_video_frames_decord( video_path: Path | str, timestamps: list[float], -) -> torch.Tensor:: +) -> torch.Tensor: video_path = str(video_path) vr = decord.VideoReader(video_path) num_frames = len(vr)