Views
No views yet
VideoChat3VisionModel implementation, vision configuration, and the ViT weights.
This vision encoder is subsequently used to initialize the visual backbone of MCG-NJU/VideoChat3-4B.1from PIL import Image
2import torch
3from transformers import AutoImageProcessor, AutoModel
4
5model_path = "MCG-NJU/I3D-ViT"
6image_path = "example.jpg"
7
8model = AutoModel.from_pretrained(
9 model_path,
10 trust_remote_code=True,
11 dtype="auto",
12 device_map="auto",
13).eval()
14processor = AutoImageProcessor.from_pretrained(model_path)
15
16image = Image.open(image_path).convert("RGB")
17inputs = processor(images=image, return_tensors="pt")
18
19pixel_values = inputs["pixel_values"].to(
20 device=model.device,
21 dtype=model.dtype,
22)
23grid_thws = inputs["image_grid_thw"].to(model.device)
24
25with torch.inference_mode():
26 image_features: list = model(
27 pixel_values=pixel_values,
28 grid_thws=grid_thws,
29 )
30
31print(image_features[0].shape)1
2import torch
3from transformers import AutoModel, AutoVideoProcessor
4
5
6model_path = "MCG-NJU/I3D-ViT"
7video_path = "example.mp4"
8num_frames = 4
9
10model = AutoModel.from_pretrained(
11 model_path,
12 trust_remote_code=True,
13 dtype="auto",
14 device_map="auto",
15).eval()
16processor = AutoVideoProcessor.from_pretrained(
17 model_path,
18 trust_remote_code=True,
19)
20
21inputs = processor(
22 videos=video_path,
23 fps=None,
24 num_frames=num_frames,
25 return_tensors="pt",
26)
27
28pixel_values = inputs["pixel_values_videos"].to(
29 device=model.device,
30 dtype=model.dtype,
31)
32grid_thws = inputs["video_grid_thw"].to(model.device)
33
34with torch.inference_mode():
35 video_features: list = model(
36 pixel_values=pixel_values,
37 grid_thws=grid_thws,
38 )
39
40print(video_features[0].shape)
41
42@misc{videochat3,
title={VideoChat3: Fully Open Video MLLM for Efficient and Generalist Video Understanding},
author={Xinhao Li and Yuhan Zhu and Xiangyu Zeng and Yuhao Dong and Haoning Wu and Zhiqiu Zhang and Yuandong Yang and Changlian Ma and Qingyu Zhang and Yansong Shi and Xinyu Chen and Haoran Chen and Zizheng Huang and Jun Zhang and Kun Ouyang and Lin Sui and Ziang Yan and Yicheng Xu and Chenting Wang and Yinan He and Hongjie Zhang and Yi Wang and Yu Qiao and Yali Wang and Ziwei Liu and Kai Chen and Limin Wang},
year={2026},
eprint={2607.14935},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2607.14935},
}