Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,138 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
tags:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
# Model Card for Model ID
|
7 |
|
8 |
-
|
|
|
|
|
9 |
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
|
14 |
-
|
15 |
|
16 |
-
|
17 |
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
|
20 |
-
-
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
|
28 |
-
### Model Sources [optional]
|
29 |
|
30 |
-
|
|
|
|
|
|
|
31 |
|
32 |
-
|
33 |
-
-
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
|
36 |
-
## Uses
|
37 |
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
|
40 |
-
### Direct Use
|
41 |
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
-
|
47 |
|
48 |
-
|
|
|
|
|
49 |
|
50 |
-
[More Information Needed]
|
51 |
|
52 |
-
### Out-of-Scope Use
|
53 |
|
54 |
-
|
55 |
|
56 |
-
[More Information Needed]
|
57 |
|
58 |
-
|
59 |
|
60 |
-
|
61 |
|
62 |
-
|
|
|
|
|
|
|
63 |
|
64 |
-
|
65 |
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
-
Use the code below to get started with the model.
|
73 |
|
74 |
-
|
75 |
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
|
78 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
-
|
107 |
-
### Testing Data, Factors & Metrics
|
108 |
-
|
109 |
-
#### Testing Data
|
110 |
-
|
111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
112 |
-
|
113 |
-
[More Information Needed]
|
114 |
-
|
115 |
-
#### Factors
|
116 |
-
|
117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
118 |
-
|
119 |
-
[More Information Needed]
|
120 |
-
|
121 |
-
#### Metrics
|
122 |
-
|
123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
124 |
-
|
125 |
-
[More Information Needed]
|
126 |
-
|
127 |
-
### Results
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Summary
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
## Model Examination [optional]
|
136 |
-
|
137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
## Environmental Impact
|
142 |
-
|
143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
144 |
-
|
145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
146 |
-
|
147 |
-
- **Hardware Type:** [More Information Needed]
|
148 |
-
- **Hours used:** [More Information Needed]
|
149 |
-
- **Cloud Provider:** [More Information Needed]
|
150 |
-
- **Compute Region:** [More Information Needed]
|
151 |
-
- **Carbon Emitted:** [More Information Needed]
|
152 |
-
|
153 |
-
## Technical Specifications [optional]
|
154 |
-
|
155 |
-
### Model Architecture and Objective
|
156 |
-
|
157 |
-
[More Information Needed]
|
158 |
-
|
159 |
-
### Compute Infrastructure
|
160 |
-
|
161 |
-
[More Information Needed]
|
162 |
-
|
163 |
-
#### Hardware
|
164 |
-
|
165 |
-
[More Information Needed]
|
166 |
-
|
167 |
-
#### Software
|
168 |
-
|
169 |
-
[More Information Needed]
|
170 |
-
|
171 |
-
## Citation [optional]
|
172 |
-
|
173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
174 |
-
|
175 |
-
**BibTeX:**
|
176 |
-
|
177 |
-
[More Information Needed]
|
178 |
-
|
179 |
-
**APA:**
|
180 |
-
|
181 |
-
[More Information Needed]
|
182 |
-
|
183 |
-
## Glossary [optional]
|
184 |
-
|
185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
## More Information [optional]
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Model Card Authors [optional]
|
194 |
-
|
195 |
-
[More Information Needed]
|
196 |
-
|
197 |
-
## Model Card Contact
|
198 |
-
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- multi-modal
|
5 |
+
- large-language-model
|
6 |
+
- video-language-model
|
7 |
+
license: apache-2.0
|
8 |
+
datasets:
|
9 |
+
- lmms-lab/LLaVA-OneVision-Data
|
10 |
+
- allenai/pixmo-docs
|
11 |
+
- HuggingFaceM4/Docmatix
|
12 |
+
- lmms-lab/LLaVA-Video-178K
|
13 |
+
- ShareGPT4Video/ShareGPT4Video
|
14 |
+
language:
|
15 |
+
- en
|
16 |
+
metrics:
|
17 |
+
- accuracy
|
18 |
+
pipeline_tag: visual-question-answering
|
19 |
---
|
20 |
|
|
|
21 |
|
22 |
+
<p align="center">
|
23 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/626938b16f8f86ad21deb989/tt5KYnAUmQlHtfB1-Zisl.png" width="150" style="margin-bottom: 0.2;"/>
|
24 |
+
<p>
|
25 |
|
26 |
|
27 |
+
<h3 align="center"><a href="https://arxiv.org/abs/2406.07476">VideoLLaMA 3: Frontier Multimodal Foundation Models for Video Understanding</a></h3>
|
28 |
|
29 |
+
<h5 align="center">
|
30 |
|
31 |
+
[\[🤗 HF Demo\]](https://huggingface.co/spaces/lixin4ever/VideoLLaMA2)
|
32 |
|
33 |
+
</h5>
|
34 |
|
|
|
35 |
|
36 |
+
<h5 align="center"> If you like our project, please give us a star ⭐ on <a href="https://github.com/DAMO-NLP-SG/VideoLLaMA3">Github</a> for the latest update. </h5>
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
|
|
38 |
|
39 |
+
## 📰 News
|
40 |
+
<!-- * **[2024.01.23]** 👋👋 Update technical report. If you have works closely related to VideoLLaMA3 but not mentioned in the paper, feel free to let us know.
|
41 |
+
* **[2024.01.22]** 🔥🔥 [Online Demo](https://huggingface.co/spaces/lixin4ever/VideoLLaMA2) is available. -->
|
42 |
+
* **[2024.01.22]** Release models and inference code of VideoLLaMA 3.
|
43 |
|
44 |
+
## 🌟 Introduction
|
45 |
+
VideoLLaMA 3 represents a state-of-the-art series of multimodal foundation models designed to excel in both image and video understanding tasks. Leveraging advanced architectures, VideoLLaMA 3 demonstrates exceptional capabilities in processing and interpreting visual content across various contexts. These models are specifically designed to address complex multimodal challenges, such as integrating textual and visual information, extracting insights from sequential video data, and performing high-level reasoning over both dynamic and static visual scenes.
|
|
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
51 |
+
## 🌎 Model Zoo
|
52 |
+
| Model | Base Model | HF Link |
|
53 |
+
| -------------------- | ------------ | ------------------------------------------------------------ |
|
54 |
+
| VideoLLaMA3-7B | Qwen2.5-7B | [DAMO-NLP-SG/VideoLLaMA3-7B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA3-7B) |
|
55 |
+
| VideoLLaMA3-2B | Qwen2.5-1.5B | [DAMO-NLP-SG/VideoLLaMA3-2B](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA3-2B) |
|
56 |
+
| VideoLLaMA3-7B-Image | Qwen2.5-7B | [DAMO-NLP-SG/VideoLLaMA3-7B-Image](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA3-7B-Image) |
|
57 |
+
| VideoLLaMA3-2B-Image (**This Checkpoint**) | Qwen2.5-1.5B | [DAMO-NLP-SG/VideoLLaMA3-2B-Image](https://huggingface.co/DAMO-NLP-SG/VideoLLaMA3-2B-Image) |
|
58 |
|
59 |
+
We also upload the tuned vision encoder of VideoLLaMA3-7B for wider application:
|
60 |
|
61 |
+
| Model | Base Model | HF Link |
|
62 |
+
| ----------------------------- | ------------------------- | ------------------------------------------------------------ |
|
63 |
+
| VideoLLaMA3-7B Vision Encoder | siglip-so400m-patch14-384 | [DAMO-NLP-SG/VL3-SigLIP-NaViT](https://huggingface.co/DAMO-NLP-SG/VL3-SigLIP-NaViT) |
|
64 |
|
|
|
65 |
|
|
|
66 |
|
67 |
+
## 🚀 Main Results
|
68 |
|
|
|
69 |
|
70 |
+
<img width="500" alt="image" src="https://cdn-uploads.huggingface.co/production/uploads/626938b16f8f86ad21deb989/70k7477DnCImzlCwZtM5e.png">
|
71 |
|
72 |
+
* \* denotes the reproduced results.
|
73 |
|
74 |
+
## 🤖 Quick Start
|
75 |
+
```python
|
76 |
+
import torch
|
77 |
+
from transformers import AutoModelForCausalLM, AutoProcessor, AutoModel, AutoImageProcessor
|
78 |
|
79 |
+
model_name = "DAMO-NLP-SG/VideoLLaMA3-2B-Image"
|
80 |
|
81 |
+
model = AutoModelForCausalLM.from_pretrained(
|
82 |
+
model_name,
|
83 |
+
trust_remote_code=True,
|
84 |
+
device_map="auto",
|
85 |
+
torch_dtype=torch.bfloat16,
|
86 |
+
attn_implementation="flash_attention_2",
|
87 |
+
)
|
88 |
+
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
|
89 |
|
90 |
+
# Image conversation
|
91 |
+
conversation = [
|
92 |
+
{
|
93 |
+
"role": "user",
|
94 |
+
"content": [
|
95 |
+
{"type": "image", "data": {"image_path": "https://github.com/DAMO-NLP-SG/VideoLLaMA3/blob/main/assets/sora.png?raw=true"}},
|
96 |
+
{"type": "text", "data": "What is the woman wearing?"},
|
97 |
+
]
|
98 |
+
}
|
99 |
+
]
|
100 |
|
101 |
+
inputs = processor(conversation=conversation, return_tensors="pt")
|
102 |
+
inputs = {k: v.cuda() if isinstance(v, torch.Tensor) else v for k, v in inputs.items()}
|
103 |
+
if "pixel_values" in inputs:
|
104 |
+
inputs["pixel_values"] = inputs["pixel_values"].to(torch.bfloat16)
|
105 |
+
output_ids = model.generate(**inputs, max_new_tokens=128)
|
106 |
+
response = processor.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
|
107 |
+
print(response)
|
108 |
+
```
|
109 |
|
|
|
110 |
|
111 |
+
## Citation
|
112 |
|
113 |
+
If you find VideoLLaMA useful for your research and applications, please cite using this BibTeX:
|
114 |
+
```bibtex
|
115 |
+
@article{damonlpsg2025videollama3,
|
116 |
+
title={VideoLLaMA 3: Frontier Multimodal Foundation Models for Image and Video Understanding},
|
117 |
+
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},
|
118 |
+
journal={arXiv preprint arXiv:2501.xxxxx},
|
119 |
+
year={2025},
|
120 |
+
url = {https://arxiv.org/abs/2501.xxxxx}
|
121 |
+
}
|
122 |
|
123 |
+
@article{damonlpsg2024videollama2,
|
124 |
+
title={VideoLLaMA 2: Advancing Spatial-Temporal Modeling and Audio Understanding in Video-LLMs},
|
125 |
+
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},
|
126 |
+
journal={arXiv preprint arXiv:2406.07476},
|
127 |
+
year={2024},
|
128 |
+
url = {https://arxiv.org/abs/2406.07476}
|
129 |
+
}
|
130 |
|
131 |
+
@article{damonlpsg2023videollama,
|
132 |
+
title = {Video-LLaMA: An Instruction-tuned Audio-Visual Language Model for Video Understanding},
|
133 |
+
author = {Zhang, Hang and Li, Xin and Bing, Lidong},
|
134 |
+
journal = {arXiv preprint arXiv:2306.02858},
|
135 |
+
year = {2023},
|
136 |
+
url = {https://arxiv.org/abs/2306.02858}
|
137 |
+
}
|
138 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|