VideoLLaMA3 ํ์ด๋ณด๊ธฐ
๐ VideoLLaMA 3: ์ต์ฒจ๋จ ๋ฉํฐ๋ชจ๋ฌ ๋น๋์ค ์ดํด ๋ชจ๋ธ
๐ ๊ฐ์
๐ ๋ ผ๋ฌธ: https://arxiv.org/abs/2501.13106
๐ ๏ธ GitHub: https://github.com/DAMO-NLP-SG/VideoLLaMA3
VideoLLaMA 3๋ ์ด๋ฏธ์ง ๋ฐ ๋น๋์ค ์ดํด๋ฅผ ์ํ ์ต์ ๋ฉํฐ๋ชจ๋ฌ ๊ธฐ๋ฐ ๋ชจ๋ธ๋ก,
์๊ฐ์ ํน์ฑ์ ๋ฐ์ํ ๋น์ ์ค์ฌ(vision-centric) ํ์ต ํจ๋ฌ๋ค์๊ณผ ํ๋ ์์ํฌ ๋์์ธ์ ์ ์ฉํ์ฌ ๊ฐ๋ ฅํ ์ฑ๋ฅ์ ์ ๊ณตํฉ๋๋ค.
๐ฏ ์ฃผ์ ํน์ง
๐ฅ ๋น์ ์ค์ฌ(vision-centric) ํ์ต ํจ๋ฌ๋ค์
๊ธฐ์กด์ ๋น๋์ค-ํ
์คํธ ๋ฐ์ดํฐ์
์ ํ์ง์ด ๋ฎ๊ฑฐ๋ ๋ถ์กฑํ ๊ฒฝ์ฐ๊ฐ ๋ง์.
์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๊ณ ํ์ง ์ด๋ฏธ์ง-ํ
์คํธ ๋ฐ์ดํฐ ์ค์ฌ์ ํ์ต์ ์ ์ฉํจ.
๐ 4๋จ๊ณ ํ์ต ๊ณผ์
1๏ธโฃ ๋น์ ์ธ์ฝ๋ ์ ์ (Vision Encoder Adaptation)
2๏ธโฃ ๋น์ -์ธ์ด ์ ๋ ฌ (Vision-Language Alignment)
3๏ธโฃ ๋ฉํฐํ์คํฌ ํ์ธํ๋ (Multi-task Fine-tuning)
4๏ธโฃ ๋น๋์ค ์ค์ฌ ํ์ธํ๋ (Video-centric Fine-tuning)
๐ฌ ํ์ ์ ์ธ ๋น๋์ค ์ฒ๋ฆฌ ๊ธฐ์
1๏ธโฃ Any-resolution Vision Tokenization (AVT)
โ ๋ค์ํ ํด์๋ ์ฒ๋ฆฌ ๊ฐ๋ฅ
โ ๋น๋์ค ๋ฐ์ดํฐ์ ๊ณ ํด์๋ ์ ๋ณด ๋ณด์กด
2๏ธโฃ Differential Frame Pruner (DiffFP)
โ ์ค๋ณต ํ๋ ์์ ์ ๊ฑฐํ์ฌ ์ฐ์ฐ๋ ๊ฐ์
โ ์ค์ํ ์ ๋ณด๋ง ์ ์งํ์ฌ ํจ์จ์ ์ธ ๋น๋์ค ์ฒ๋ฆฌ
3๏ธโฃ ๊ณ ํ์ง ๋ฐ์ดํฐ์ ํ์ฉ
- VL3-Syn7M ๋ฐ์ดํฐ์ ๊ตฌ์ถ (7๋ฐฑ๋ง ๊ฐ์ ๊ณ ํ์ง ์ด๋ฏธ์ง-ํ ์คํธ ์)
- OCR ๋ฐ์ดํฐ, ์ฐจํธ ๋ถ์ ๋ฐ์ดํฐ, ์ํ์ ์๊ฐ์ ๋ฌธ์ ํด๊ฒฐ ๋ฐ์ดํฐ ํฌํจ
4๏ธโฃ ๋๊ท๋ชจ ์ฌ์ ํ์ต
- OpenAI, Meta ๋ฑ์ ์ต์ ์ฐ๊ตฌ ๋ฐ์ํ Qwen2.5 LLM ๋ชจ๋ธ ๊ธฐ๋ฐ
- ์ฌ์ ํ๋ จ๋ SigLIP ๋น์ ์ธ์ฝ๋ ๊ฐ์
๐ ์ฑ๋ฅ ํ๊ฐ
๐ผ๏ธ ์ด๋ฏธ์ง ์ดํด ์ฑ๋ฅ
๋ชจ๋ธ | ChartQA | DocVQA | MathVista | MMMU-Pro | RealWorldQA |
---|---|---|---|---|---|
VideoLLaMA 3 (7B) | 86.3 | 94.9 | 67.1 | 33.6 | 72.7 |
Qwen2-VL 7B | 83.0 | 94.5 | 58.2 | 31.4 | 70.1 |
LLaVA-OneVision | 80.0 | 87.5 | 63.2 | 24.1 | 66.3 |
๐ฌ ๋น๋์ค ์ดํด ์ฑ๋ฅ
๋ชจ๋ธ | VideoMME | PerceptionTest | MLVU | TempCompass | NextQA |
---|---|---|---|---|---|
VideoLLaMA 3 (7B) | 66.2 | 72.8 | 73.0 | 68.1 | 84.5 |
InternVL2.5 8B | 64.2 | 68.9 | 69.0 | 68.3 | 85.0 |
Qwen2-VL 7B | 63.3 | 62.3 | 69.8 | 67.9 | 81.2 |
โ ๋๋ถ๋ถ์ ๋ฒค์น๋งํฌ์์ SOTA ์ฑ๋ฅ ๋ฌ์ฑ!
๐ ๏ธ ์ค์น ๋ฐ ์ฌ์ฉ๋ฒ
๐ ๊ธฐ๋ณธ ํ๊ฒฝ ์ค์
1
2
3
4
pip install torch==2.4.0 torchvision==0.17.0 --extra-index-url https://download.pytorch.org/whl/cu118
pip install flash-attn --no-build-isolation
pip install transformers==4.46.3 accelerate==1.0.1
pip install decord ffmpeg-python imageio opencv-python
๐ ๋ชจ๋ธ ๋ค์ด๋ก๋
1
2
3
git clone https://github.com/DAMO-NLP-SG/VideoLLaMA3
cd VideoLLaMA3
pip install -r requirements.txt
๐ ์ถ๋ก (Inference) ์ฝ๋ ์์
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import torch
from transformers import AutoModelForCausalLM, AutoProcessor
device = "cuda:0"
model_path = "DAMO-NLP-SG/VideoLLaMA3-7B"
model = AutoModelForCausalLM.from_pretrained(
model_path, trust_remote_code=True, device_map={"": device},
torch_dtype=torch.bfloat16, attn_implementation="flash_attention_2",
)
processor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)
conversation = [
{"role": "system", "content": "You are a helpful assistant."},
{
"role": "user",
"content": [
{"type": "video", "video": {"video_path": "./assets/cat_and_chicken.mp4", "fps": 1, "max_frames": 180}},
{"type": "text", "text": "What is the cat doing?"}
]
},
]
inputs = processor(conversation=conversation, add_system_prompt=True, add_generation_prompt=True, return_tensors="pt")
inputs = {k: v.to(device) if isinstance(v, torch.Tensor) else v for k, v in inputs.items()}
output_ids = model.generate(**inputs, max_new_tokens=1024)
response = processor.batch_decode(output_ids, skip_special_tokens=True)[0].strip()
print(response)
๐ ํ์ฉ ์ฌ๋ก
๐ผ๏ธ ์ฐจํธ ๋ถ์ (Chart Understanding)
๐ ์ง๋ฌธ: ์ด ์ฃผ์์ ๋ณด์ ํ ๊ฐ์น๊ฐ ์์๊น?
๐ VideoLLaMA 3์ ๋ต๋ณ: โํด๋น ์ฃผ์์ ๋ณ๋์ฑ์ด ํฌ๊ณ ํฌ์ ์ํ์ด ๋์ ๋ณด์
๋๋ค.โ
๐ OCR ๋ฐ ๋ฌธ์ ์ดํด (Document Understanding)
๐ ์ง๋ฌธ: ๋ฌธ์์ ๋ด์ฉ์ ์์ฝํด ์ฃผ์ธ์.
๐ VideoLLaMA 3์ ๋ต๋ณ: โ๋ฌธ์์์ ์ฝ์ ์ฃผ์ ๋ด์ฉ์โฆโ
๐ฌ ๋น๋์ค ์บก์ ์์ฑ (Video Captioning)
๐ ์ง๋ฌธ: ์ด ๋น๋์ค์ ๋ด์ฉ์ ์ค๋ช
ํด ์ฃผ์ธ์.
๐ VideoLLaMA 3์ ๋ต๋ณ: โ์ด ๋น๋์ค๋ ์ฐ์ฃผ์ ์ด ๊ถค๋๋ฅผ ๋๋ ์ฅ๋ฉด์ผ๋ก ์์๋ฉ๋๋คโฆโ
๐ ๊ฒฐ๋ก
VideoLLaMA 3๋ ์ต์ ๋ฉํฐ๋ชจ๋ฌ AI ๋ชจ๋ธ ์ค ์ต๊ฐ์ ์ฑ๋ฅ์ ์ ๊ณตํ๋ฉฐ, ํนํ ๋น๋์ค ๋ฐ ์ด๋ฏธ์ง ์ดํด์์ ๊ฐ๋ ฅํ ์ฑ๋ฅ์ ๋ฐํํฉ๋๋ค.
โ ๋น์ ์ค์ฌ ํ์ต ํจ๋ฌ๋ค์ ์ ์ฉ
โ SOTA ์ฑ๋ฅ ๋ฌ์ฑ (์ต์ ๋ฒค์น๋งํฌ 1์ ๊ธฐ๋ก)
โ ๋น๋์ค ์บก์
, OCR, ์ฐจํธ ๋ถ์, ๋ฌธ์ ์ดํด ๋ฑ ๋ค์ํ ํ์ฉ ๊ฐ๋ฅ