SuperAPIAI Directory

TinyLLaVA-Video

github.com · AI developer platforms

TinyLLaVA-Video is a small-scale Large Multimodal Model (LMM) framework for video understanding, built on TinyLLaVA_Factory. Its model parameter count does not exceed 4B, and it can process video sequences in a simple way without requiring a complex architecture, while supporting fps sampling and uniform frame sampling. The framework's effectiveness has been verified through experiments; the best model achieves performance on multiple video understanding benchmarks comparable to some existing 7B models, and requires only one day of training on 8 A100-40G GPUs. The project provides installation, data preparation, training, evaluation, and inference scripts, supports LLMs such as Qwen2.5, and provides evaluation on 5 benchmarks including Video-MME, MVBench, LongVideoBench, MLVU, and MMVU. The repository has also released the TinyLLaVA-Video-R1 video reasoning work and the related arXiv paper.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)

About this tool

TinyLLaVA-Video is a small-scale Large Multimodal Model (LMM) framework built on TinyLLaVA_Factory, aimed at video understanding tasks. The framework processes video sequences in a relatively simple way and does not require a complex architecture. Its model parameter count does not exceed 4B, and it supports both fps sampling and uniform frame sampling. The project has verified the effectiveness of the framework through experiments: the best model's performance on multiple video understanding benchmarks is comparable to some existing 7B models. In terms of training, it requires only one day of training on 8 A100-40G GPUs.

Main capabilities and updates:

  • 2024-12 Released the TinyLLaVA-Video repository.
  • 2025-01 Released the arXiv paper TinyLLaVA-Video: Towards Smaller LMMs for Video Understanding with Group Resampler.
  • 2025-04 Released the new work TinyLLaVA-Video-R1 for video reasoning.

Installation and requirements:

  • Clone the repository and enter the folder.
  • Create a conda environment, activate it, and install the dependency packages.
  • Install additional packages.

Data preparation:

  • The data comes from a combination of parts of two datasets, LLaVA-Video-178K and Valley.
  • Four subsets of LLaVA-Video-178K were used: 0_30_s_academic_v0_1, 30_60_s_academic_v0_1, 0_30_s_youtube_v0_1, 30_60_s_youtube_v0_1, supplemented with filtered Video-LLaVA.
  • The organized pretraining annotations and fine-tuning annotations can be downloaded from the specified links (see the original repository for the specific links).
  • The files and annotation files need to be placed in path/to/your/dataset according to the specified structure.

Training:

  • You can refer to TinyLLaVA_Factory to modify components such as "llm", "vision_tower", and "train_recipe".
  • An example of training an LMM using Qwen2.5 is provided.
  • You need to replace the data path in scripts/train/qwen2/train_qwen2_base_video.sh; in pretrain_qwIn en2_video.sh, replace output_dir; in finetune_qwen2_video.sh, replace pretrained_model_path and output_dir; and adjust the GPU id and per_device_train_batch_size.
  • Important hyperparameters: Global Batch Size = num of GPUs * per_device_train_batch_size * gradient_accumulation_steps. It is recommended to keep the global batch size and learning rate unchanged except for LoRA tuning.

Evaluation:

  • Evaluation is currently provided on 5 benchmarks: Video-MME, MVBench, LongVideoBench, MLVU, MMVU.
  • Each benchmark needs to be downloaded and placed in the corresponding directory under path/to/your/dataset/eval/.
  • You need to modify parameters such as MODEL_PATH, MODEL_NAME, EVAL_DIR, conv-mode in the corresponding scripts under scripts/eval/ (Video-MME also requires setting duration, optional short, medium, long).
  • Example single-GPU inference command: CUDA_VISIBLE_DEVICES=0 bash scripts/eval/videomme.sh (other benchmarks are similar).

Models and inference:

  • The provided models include TinyLLaVA-Video-Qwen2.5-3B-Group-16-512, TinyLLaVA-Video-Qwen2.5-3B-Group-1fps-512, TinyLLaVA-Video-Phi2-Naive-16-512, TinyLLaVA-Video-Qwen2.5-3B-Naive-16-512.
  • In the naming, 16 means sampling 16 frames, and 512 means using 512 tokens (queries) to represent the video sequence. In the script, you can set num_frame, max_frame = 16 to correspond to "16-512", and set num_frame = -1, max_frame = 64 or 128 to correspond to "1fps-512",.
  • A quick inference script is provided: modify model_path, prompt, video_file and conv-mode in eval.py, then run it using the single-GPU inference command.

Applicable scenarios and limitations:

  • Suitable for video understanding, multimodal research, and small-scale LMM training and evaluation.
  • Requires GPU resources (8 A100-40G are recommended for training).
  • Depends on downloading specific datasets and annotations, and data needs to be organized according to the specified structure.
  • Specific performance data, prices, fees, and other information are not yet provided.

Community and acknowledgements:

  • The repository is based on the TinyLLaVA_Factory project, and the codebase is built on top of the LLaVA project.
  • If it is useful in your research, it is recommended to star and cite it.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools