MViTv2: Improved Multiscale Vision Transformers for Classification and Detection

August 20, 2022 ยท View on GitHub

Official PyTorch implementation of MViTv2, from the following paper:

MViTv2: Improved Multiscale Vision Transformers for Classification and Detection. CVPR 2022.
Yanghao Li*, Chao-Yuan Wu*, Haoqi Fan, Karttikeya Mangalam, Bo Xiong, Jitendra Malik, Christoph Feichtenhofer*


MViT is a multiscale transformer which serves as a general vision backbone for different visual recognition tasks. PySlowFast supports MViTv2 for video action recognition and detection tasks. For other tasks, please check:

Image Classification: See MViTv2 for image classification.

Object Detection and Instance Segmentation: See MViTv2 in Detectron2.


Results

Kinetics-400

nameframe length x sample ratetop1top5Flops (G) x views#params (M)modelconfig
MViTv2-S16 x 481.094.664 x 1 x 534.5linkKinetics/MVITv2_S_16x4
MViTv2-B32 x 382.995.7225 x 1 x 551.2linkKinetics/MVITv2_B_32x3
MViTv2-L40 x 386.197.02828 x 3 x 5217.6linkKinetics/MVITv2_L_40x3_test

SSv2

namepretrainframe length x sample ratetop1top5Flops (G) x views#params (M)modelconfig
MViTv2-SK40016 x 468.291.464 x 3 x 134.4linkSSv2/MVITv2_S_16x4
MViTv2-BK40032 x 370.592.7225 x 3 x 151.1linkSSv2/MVITv2_B_32x3
MViTv2-LIN21K + K40040 x 373.394.12828 x 3 x 1213.1linkSSv2/MVITv2_L_40x3

ImageNet-1K

nameresolutionacc@1#paramsFLOPs1k model
MViTv2-T224x22482.324M4.7Gmodel
MViTv2-S224x22483.635M7.0Gmodel
MViTv2-B224x22484.452M10.2Gmodel

For more ImageNet results, please check the MViTv2 for image classification repo.

Get started

Here we can train a standard MViTv2 model from scratch by:

python tools/run_net.py \
  --cfg configs/Kinetics/MVITv2_S_16x4.yaml \
  DATA.PATH_TO_DATA_DIR path_to_your_dataset \

Citing MViTv2

If you find this repository helpful, please consider citing:

@inproceedings{li2021improved,
  title={MViTv2: Improved multiscale vision transformers for classification and detection},
  author={Li, Yanghao and Wu, Chao-Yuan and Fan, Haoqi and Mangalam, Karttikeya and Xiong, Bo and Malik, Jitendra and Feichtenhofer, Christoph},
  booktitle={CVPR},
  year={2022}
}

@inproceedings{fan2021multiscale,
  title={Multiscale vision transformers},
  author={Fan, Haoqi and Xiong, Bo and Mangalam, Karttikeya and Li, Yanghao and Yan, Zhicheng and Malik, Jitendra and Feichtenhofer, Christoph},
  booktitle={ICCV},
  year={2021}
}