🚀 transformers
このモデルは、VideoLLaMA3における視覚エンコーダとして機能し、様々な解像度の画像や動画を動的に処理することができます。
もし当プロジェクトが気に入っていただけたら、Githubでスター⭐をして最新情報をゲットしてください。
🌟 紹介
このモデルは、VideoLLaMA3の視覚エンコーダとして機能します。
VideoLLaMA3は、Any-resolution Vision Tokenization (AVT) アプローチを利用して、様々な解像度の画像や動画を動的に処理します。これは、事前学習されたビジョンエンコーダ(ViTアーキテクチャに基づく)を適応させ、ViTで従来使用されていた絶対位置埋め込みの代わりに2D-RoPE(Rotary Position Embeddings)を使用することで実現されます。
AVTにより、VideoLLaMA3は異なる解像度で画像や動画をより詳細に表現することができ、ビジョントークンにより多くの情報を含めることができます。AVTとのシームレスな統合を確保するために、ビジョンエンコーダとプロジェクターの両方を、Vision Encoder Adaptation段階(VideoLLaMA3トレーニングパイプラインの段階 #1)で、シーン画像、ドキュメントデータ、およびテキスト付きのシーン画像を使用してファインチューニングします。
トレーニング前に、モデルのパラメータとアーキテクチャはSigLipから初期化されます。
🚀 モデルの性能
ベースモデル |
GQA |
AI2D |
ChartQA |
DocVQAval |
MME |
clip-vit-large-patch14-336 |
61.50 |
56.28 |
18.32 |
24.86 |
1668.41 |
dfn5B-clip-vit-h-14-378 |
62.70 |
56.87 |
16.40 |
23.09 |
1665.35 |
siglip-so400m-patch14-384 (当実装) |
62.92 |
57.12 |
22.44 |
31.32 |
1667.92 |
- より詳細な分析は、当研究論文paperで確認できます。
🚀 クイックスタート
import torch
from transformers import AutoModel, AutoImageProcessor
from transformers.image_utils import load_image
model_name = "DAMO-NLP-SG/VL3-SigLIP-NaViT"
image_path = "https://github.com/DAMO-NLP-SG/VideoLLaMA3/blob/main/assets/sora.png?raw=true"
images = load_image(image_path)
model = AutoModel.from_pretrained(
model_name,
trust_remote_code=True,
device_map="auto",
torch_dtype=torch.bfloat16,
attn_implementation="flash_attention_2",
)
processor = AutoImageProcessor.from_pretrained(model_name, trust_remote_code=True)
inputs = processor(images=images, merge_size=1)
inputs = {k: torch.tensor(v).cuda() for k, v in inputs.items()}
if "pixel_values" in inputs:
inputs["pixel_values"] = inputs["pixel_values"].to(torch.bfloat16)
image_features = model(**inputs)
引用
もしVideoLLaMAがあなたの研究やアプリケーションに役立つと思われる場合は、次のBibTeXを使用して引用してください。
@article{damonlpsg2025videollama3,
title={VideoLLaMA 3: Frontier Multimodal Foundation Models for Image and Video Understanding},
author={Boqiang Zhang, Kehan Li, Zesen Cheng, Zhiqiang Hu, Yuqian Yuan, Guanzheng Chen, Sicong Leng, Yuming Jiang, Hang Zhang, Xin Li, Peng Jin, Wenqi Zhang, Fan Wang, Lidong Bing, Deli Zhao},
journal={arXiv preprint arXiv:2501.13106},
year={2025},
url = {https://arxiv.org/abs/2501.13106}
}
@article{damonlpsg2024videollama2,
title={VideoLLaMA 2: Advancing Spatial-Temporal Modeling and Audio Understanding in Video-LLMs},
author={Cheng, Zesen and Leng, Sicong and Zhang, Hang and Xin, Yifei and Li, Xin and Chen, Guanzheng and Zhu, Yongxin and Zhang, Wenqi and Luo, Ziyang and Zhao, Deli and Bing, Lidong},
journal={arXiv preprint arXiv:2406.07476},
year={2024},
url = {https://arxiv.org/abs/2406.07476}
}
@article{damonlpsg2023videollama,
title = {Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding},
author = {Zhang, Hang and Li, Xin and Bing, Lidong},
journal = {arXiv preprint arXiv:2306.02858},
year = {2023},
url = {https://arxiv.org/abs/2306.02858}
}
📄 ライセンス
このプロジェクトは、Apache-2.0ライセンスの下で提供されています。