Revert "feat: replace Decord with video_reader-rs" (#8077)
This commit is contained in:
@@ -206,7 +206,7 @@ class BaseMultimodalProcessor(ABC):
|
||||
estimate the total frame count from all visual input
|
||||
"""
|
||||
# Lazy import because decord is not available on some arm platforms.
|
||||
from video_reader import PyVideoReader, cpu
|
||||
from decord import VideoReader, cpu
|
||||
|
||||
# Before processing inputs
|
||||
if not image_data or len(image_data) == 0:
|
||||
@@ -216,7 +216,7 @@ class BaseMultimodalProcessor(ABC):
|
||||
if isinstance(image, str) and image.startswith("video:"):
|
||||
path = image[len("video:") :]
|
||||
# Estimate frames for the video
|
||||
vr = PyVideoReader(path, threads=0)
|
||||
vr = VideoReader(path, ctx=cpu(0))
|
||||
num_frames = len(vr)
|
||||
else:
|
||||
# For images, each contributes one frame
|
||||
|
||||
Reference in New Issue
Block a user