🚀 视频在线大语言模型(VideoLLM-online)
VideoLLM-online 是一款用于流式视频的在线视频大语言模型,支持多模态交互,能有效处理视频流理解等任务,在视频文本生成等方面具有显著价值。
🚀 快速开始
首先,克隆 GitHub 仓库并按照安装说明进行操作:
git clone https://github.com/showlab/videollm-online
确保你已经安装了 Miniconda 且 Python 版本 >= 3.10,然后运行以下命令:
conda install -y pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
pip install transformers accelerate deepspeed peft editdistance Levenshtein tensorboard gradio moviepy submitit
pip install flash-attn --no-build-isolation
PyTorch 源会安装 ffmpeg,但版本较旧,通常会导致预处理质量很低。请按照以下步骤安装最新版本的 ffmpeg:
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar xvf ffmpeg-release-amd64-static.tar.xz
rm ffmpeg-release-amd64-static.tar.xz
mv ffmpeg-7.0.1-amd64-static ffmpeg
如果你想在实时流中使用音频来尝试我们的模型,请同时克隆 ChatTTS:
pip install omegaconf vocos vector_quantize_pytorch cython
git clone git+https://github.com/2noise/ChatTTS
mv ChatTTS demo/rendering/
python -m demo.app --resume_from_checkpoint chenjoya/videollm-online-8b-v1plus
python -m demo.cli --resume_from_checkpoint chenjoya/videollm-online-8b-v1plus
✨ 主要特性
- 多模态支持:结合了大语言模型(LLM)和视觉策略,实现视频文本的多模态处理。
- 灵活的帧率设置:训练时帧率为 2,推理时帧率在 2 - 10 之间。
- 长视频处理:能够处理长达 10 分钟的视频。
📦 安装指南
克隆仓库
git clone https://github.com/showlab/videollm-online
安装依赖
conda install -y pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia
pip install transformers accelerate deepspeed peft editdistance Levenshtein tensorboard gradio moviepy submitit
pip install flash-attn --no-build-isolation
安装最新版 ffmpeg
wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar xvf ffmpeg-release-amd64-static.tar.xz
rm ffmpeg-release-amd64-static.tar.xz
mv ffmpeg-7.0.1-amd64-static ffmpeg
克隆 ChatTTS(可选)
pip install omegaconf vocos vector_quantize_pytorch cython
git clone git+https://github.com/2noise/ChatTTS
mv ChatTTS demo/rendering/
📚 详细文档
模型详情
属性 |
详情 |
大语言模型(LLM) |
meta-llama/Meta-Llama-3-8B-Instruct |
视觉策略 - 帧编码器 |
google/siglip-large-patch16-384 |
视觉策略 - 帧令牌 |
CLS 令牌 + 平均池化 3x3 令牌 |
视觉策略 - 帧帧率 |
训练时为 2,推理时为 2~10 |
视觉策略 - 帧分辨率 |
最大分辨率 384,零填充以保持宽高比 |
视觉策略 - 视频长度 |
10 分钟 |
训练数据 |
Ego4D 叙述流 113K + Ego4D 目标步骤流 21K |
模型来源
- 仓库地址:https://github.com/showlab/videollm-online
- 论文地址:https://arxiv.org/abs/2406.11816
📄 许可证
本模型采用 MIT 许可证。
📚 引用信息
@inproceedings{videollm-online,
author = {Joya Chen and Zhaoyang Lv and Shiwei Wu and Kevin Qinghong Lin and Chenan Song and Difei Gao and Jia-Wei Liu and Ziteng Gao and Dongxing Mao and Mike Zheng Shou},
title = {VideoLLM-online: Online Video Large Language Model for Streaming Video},
booktitle = {CVPR},
year = {2024},
}