Ml Slowfast Llava
SlowFast-LLaVA: A Strong Training-Free Baseline for Video Large Language Models
Install / Use
npx skills add apple/ml-slowfast-llavaInstalls into whichever agent you are using.
README
SlowFast-LLaVA: A Strong Training-Free Baseline for Video Large Language Models
This project accompanies the research paper,
SlowFast-LLaVA: A Strong Training-Free Baseline for Video Large Language Models <br> Mingze Xu*, Mingfei Gao*, Zhe Gan, Hong-You Chen, Zhengfeng Lai, Haiming Gang, Kai Kang, Afshin Dehghan
<p align="center"> <img src="assets/teaser.png" width="600"> </p>SlowFast-LLaVA is a training-free multimodal large language model (LLM) for video understanding and reasoning. Without requiring fine-tuning on any data, it achieves comparable or even better performance compared to state-of-the-art Video LLMs on a wide range of VideoQA tasks and benchmarks, as shown in the figure.
Table of contents
Getting Started
Installation
-
The code is developed with CUDA 11.7, Python >= 3.10.12, PyTorch >= 2.1.0
-
[Optional but recommended] Create a new conda environment.
conda create -n sf_llava python=3.10.12And activate the environment.
conda activate sf_llava -
Install the requirements.
bash setup_env.sh -
Add OpenAI key and organization to the system environment to use GPT-3.5-turbo for model evaluation.
export OPENAI_API_KEY=$YOUR_OPENAI_API_KEY export OPENAI_ORG=$YOUR_OPENAI_ORG # optional -
Download pre-trained LLaVA-NeXT weights from
HuggingFace, and put them under theml-slowfast-llavafolder.git lfs clone https://huggingface.co/liuhaotian/llava-v1.6-vicuna-7b liuhaotian/llava-v1.6-vicuna-7b git lfs clone https://huggingface.co/liuhaotian/llava-v1.6-34b liuhaotian/llava-v1.6-34b
-
Data Preparation
-
We prepare the ground-truth question and answer files based on
IG-VLM, and put them under playground/gt_qa_files.- MSVD-QA
- Download the
MSVD_QA.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_msvd_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- MSRVTT-QA
- Download the
MSRVTT_QA.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_msrvtt_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- TGIF-QA
- Download the
TGIF_FrameQA.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_tgif_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- Activitynet-QA
- Download the
Activitynet_QA.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_activitynet_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- NExT-QA
- Download the
NExT_QA.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_nextqa_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- EgoSchema
- Download the
EgoSchema.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_egoschema_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- IntentQA
- Download the
IntentQA.csvfrom thehere - Reformat the files by running
python scripts/data/prepare_intentqa_qa_file.py --qa_file $PATH_TO_CSV_FILE
- Download the
- VCGBench
- Download all files under
text_generation_benchmark - Reformat the files by running
python scripts/data/prepare_vcgbench_qa_file.py --qa_folder $TEXT_GENERATION_BENCHMARK
- Download all files under
- MSVD-QA
-
Download the raw videos from the official websites.
-
Openset VideoQA
- [Recomanded] Option 1: Follow the instruction in
Video-LLaVAto download raw videos. - Option 2: Download videos from the data owners.
- [Recomanded] Option 1: Follow the instruction in
-
Multiple Choice VideoQA
-
Text Generation
- The videos are based on ActivityNet, and you can reuse the one from Openset VideoQA.
-
-
Organize the raw videos under playground/data.
- To directly use our data loaders
Related Skills
qqbot-channel
385.5kQQ channel management skill. Use qqbot_channel_api for explicit QQ channel-management requests; confirm write, delete, and bulk actions before calling authenticated QQ Open Platform endpoints.
docs-writer
106.4kAlways use this skill when the task involves writing, reviewing, or editing files in the `/docs` directory or any `.md` files in the repository.
cpp
40.5kGuide Cursor to write modern C++ and CMake code with clear structure, RAII, const-correctness, and safe error handling.
gamemaker-gml
40.5kGameMaker Language (GML) rules for scripts, objects, events, rooms, data structures, and performance-minded game code
