Home

Awesome

<div align="center"> <img src="./assets/logo_trans.png" style='width: 25%'> <h2></img><a href="https://arxiv.org/abs/2403.09626">Video Mamba Suite: State Space Model as a Versatile Alternative for Video Understanding</a></h2>

Guo Chen, Yifei Huang, Jilan Xu, Baoqi Pei, Zhe Chen, Zhiqi Li, Jihao Wang, Kunchang Li, Tong Lu and Limin Wang.

</div>

Introduction

teaser Understanding videos is one of the fundamental directions in computer vision research, with extensive efforts dedicated to exploring various architectures such as RNN, 3D CNN, and Transformers. The newly proposed architecture of state space model, e.g, Mamba, shows promising traits to extend its success in long sequence modeling to video modeling. To assess whether Mamba can be a viable alternative to Transformers in the video understanding domain, in this work, we conduct a comprehensive set of studies, probing different roles Mamba can play in modeling videos, while investigating diverse tasks where Mamba could exhibit superiority. We categorize Mamba into four roles for modeling videos, deriving a Video Mamba Suite composed of 14 models/modules, and evaluating them on 12 video understanding tasks. Our extensive experiments reveal the strong potential of Mamba on both video-only and video-language tasks while showing promising efficiency-performance trade-offs. We hope this work could provide valuable data points and insights for future research on video understanding.

πŸ“’ News

(2024/04/01) The code of related tasks for Video Temporal Adapter and Spatial-temporal modeling has been released. They contain multi-instance retrieval, action recognition, long video quesion-answer on EK100, Kinetics400, and EgoSchema. If there exist bug or missing packages, please submit a new issue to tell me.

(2024/03/21) The code of related tasks for Video Temporal Modeling and Cross-modal Interaction has been released.

(2024/03/15) πŸ”„The repository is public.

(2024/03/12) πŸ”„The repository is created.

Preliminary Installation

  1. Install the preliminary requirements.
# clone video-mamba-suite
git clone --recursive https://github.com/OpenGVLab/video-mamba-suite.git

# create environment
conda create -n video-mamba-suite python=3.9
conda activate video-mamba-suite

# install pytorch
pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu118

# install requirements
pip install -r requirement.txt

# install mamba
cd causal-conv1d
python setup.py develop
cd ..
cd mamba
python setup.py develop
cd ..
  1. For each tasks, enter their folders to follow installation instructions.

  2. If requirement.txt is missing some libraries, please propose an issue as soon as possible.

Supported tasks

Mamba for Video Temporal Modeling

tasksupported datasets
Temporal Action LocalizationActivityNet, HACS Segment, FineAction, THUMOS-14
Temporal Action SegmentationGTEA, Breakfast, 50salads
Video dense captioningActivityNet, YouCook2
Video paragraph captioningActivityNet, YouCook2
Action AnticipationEpic-kitchen-100

Mamba for Cross-modal Interaction

tasksupported datasets
Video Temporal GroundingQvHighlight, Charade-STA
Highlight DetectionQvHighlight

Mamba as Video Temporal Adapter

tasksupported datasets
Zero-shot/Finetuned Multi-instance RetrievalEpic-kitchen-100
Finetuned Action RecognitionEpic-kitchen-100
Long-form Video Question-AnswerEgoSchema

Mamba for Spatial-temporal Modeling

tasksupported datasets
Zero-shot/Finetuned Multi-instance RetrievalEpic-kitchen-100
Finetuned Action RecognitionKinetics-400

Model Zoo

The models of Mamba as Video Temporal Adapter and Mamba for Spatial-temporal Modeling.

ModelPretrain-IPretrain-VFinetuned#FrameWeight
TimeSformer-B (Vanilla)CLIP-400MEgo4D-4M-4πŸ€— HF link
TimeSformer-B (Frozen)CLIP-400MEgo4D-4M-4πŸ€— HF link
TimeMamba-B (Vanilla)CLIP-400MEgo4D-4M-4πŸ€— HF link
TimeMamba-B (Frozen)CLIP-400MEgo4D-4M-4πŸ€— HF link
TimeSformer-B (Vanilla)CLIP-400MEgo4D-4MEK100-CLS4->16πŸ€— HF link
TimeSformer-B (Vanilla)CLIP-400MEgo4D-4MEK100-MIR4->16πŸ€— HF link
TimeMamba-B (Vanilla)CLIP-400MEgo4D-4MEK100-CLS4->16πŸ€— HF link
TimeMamba-B (Vanilla)CLIP-400MEgo4D-4MEK100-MIR4->16πŸ€— HF link
ViT-Tdeit,IN1KEgo4D-4M-16πŸ€— HF link
ViT-Sdeit,IN1KEgo4D-4M-16πŸ€— HF link
ViViM-Tdeit,IN1KEgo4D-4M-16πŸ€— HF link
ViViM-Sdeit,IN1KEgo4D-4M-16πŸ€— HF link
ViViM-Tdeit,IN1K-K40016x3x4πŸ€— HF link
ViViM-Sdeit,IN1K-K40016x3x4πŸ€— HF link

Cite

If you find this repository useful, please use the following BibTeX entry for citation.

@misc{2024videomambasuite,
      title={Video Mamba Suite: State Space Model as a Versatile Alternative for Video Understanding}, 
      author={Guo Chen, Yifei Huang, Jilan Xu, Baoqi Pei, Zhe Chen, Zhiqi Li, Jiahao Wang, Kunchang Li, Tong Lu, Limin Wang},
      year={2024},
      eprint={2403.09626},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

License

This project is released under the MIT License

Acknowledgement

This repository is built based on ActionFormer, UniVTG, ASFormer, PDVC, Testra, MAT, AVION, InternVideo, EgoSchema, ViM and Mamba repository.