Revert "[Misc][Minimax-M3]add default video_processor (#50092)" (#50313)
Nick Hill committed
Jul 29, 2026 at 13:46 UTC
2ecd8645d87e7c0716e5bc4347620e91e137619d
2 files changed
+7
-44
tests/multimodal/test_video.py
-7
@@ -14,7 +14,6 @@ from transformers import AutoVideoProcessor
14
from transformers.video_utils import VideoMetadata
15
16
from vllm.assets.base import get_vllm_public_assets
17
-from vllm.models.minimax_m3.common.mm_preprocess import MiniMaxM3VideoBackend
17
from vllm.multimodal.video import (
18
PYNVVIDEOCODEC_DECODER_CACHE_SIZE,
19
PYNVVIDEOCODEC_VIDEO_BACKEND,
@@ -389,12 +388,6 @@ def test_cosmos3_edge_uses_qwen3_vl_video_backend():
388
{"fps": 2},
389
id="qwen2_5_vl",
390
),
392
- pytest.param(
393
- "MiniMaxAI/MiniMax-M3",
394
- MiniMaxM3VideoBackend,
395
- None,
396
- id="minimax_m3_vl",
397
- ),
391
],
392
)
393
def test_video_processor_from_model_repo(
vllm/models/minimax_m3/common/mm_preprocess.py
+7
-37
@@ -3,9 +3,8 @@
3
4
import math
5
from collections.abc import Mapping, Sequence
6
-from typing import Any, Literal, cast
6
+from typing import cast
7
8
-import numpy.typing as npt
8
import torch
9
from transformers import BatchFeature
10
from transformers.video_utils import VideoMetadata
@@ -470,39 +469,10 @@ class MiniMaxM3VLMultiModalProcessor(
469
]
470
471
473
-@VIDEO_LOADER_REGISTRY.register(
474
- name="minimax_m3_vl",
475
- video_processor="MiniMaxM3VLVideoProcessor",
476
-)
472
+# TODO(Isotr0py): Tie with MinimaxVideoProcessor
473
+# after https://github.com/vllm-project/vllm/pull/44126
474
+@VIDEO_LOADER_REGISTRY.register("minimax_m3_vl")
475
class MiniMaxM3VideoBackend(VideoBackend):
478
- @classmethod
479
- def load_bytes(
480
- cls,
481
- data: bytes,
482
- num_frames: int = -1,
483
- fps: int = 1,
484
- max_duration: int = 300,
485
- frame_recovery: bool = False,
486
- *,
487
- backend: Literal[
488
- "opencv",
489
- "pyav",
490
- "torchcodec",
491
- "pynvvideocodec",
492
- "deepstream",
493
- ] = "opencv",
494
- **kwargs,
495
- ) -> tuple[npt.NDArray, dict[str, Any]]:
496
- return super().load_bytes(
497
- data,
498
- num_frames=num_frames,
499
- fps=fps,
500
- max_duration=max_duration,
501
- frame_recovery=frame_recovery,
502
- backend=backend,
503
- **kwargs,
504
- )
505
-
476
@classmethod
477
def compute_frames_index_to_sample(
478
cls,
@@ -513,6 +483,7 @@ class MiniMaxM3VideoBackend(VideoBackend):
483
total_frames = source.total_frames_num
484
video_fps = source.original_fps
485
fps = target.fps
486
+
487
if total_frames <= 0 or video_fps <= 0 or fps <= 0:
488
return [0] if total_frames > 0 else []
489
@@ -532,9 +503,8 @@ class MiniMaxM3VideoBackend(VideoBackend):
503
break
504
indices.append(target_frame)
505
prev_kept_ts = target_frame / video_fps
535
- # Because HF sample_frames includes the last frame,
536
- # we will use HF as the standard.
537
- last_frame_idx = total_frames
506
+
507
+ last_frame_idx = total_frames - 1
508
last_ts = last_frame_idx / video_fps
509
if indices and indices[-1] != last_frame_idx and last_ts - prev_kept_ts > eps:
510
indices.append(last_frame_idx)