Home

Awesome

MixFormer

The official implementation of the CVPR 2022 paper MixFormer: End-to-End Tracking with Iterative Mixed Attention

PWC

PWC

PWC

[Models and Raw results] (Google Driver) [Models and Raw results] (Baidu Driver: hmuv)

MixFormer_Framework

News

[Jan 01, 2024]

[Feb 10, 2023]

[Feb 8, 2023]

[Oct 26, 2022]

[Mar 29, 2022]

[Mar 21, 2022]

Highlights

:sparkles: New transformer tracking framework

MixFormer is composed of a target-search mixed attention (MAM) based backbone and a simple corner head, yielding a compact tracking pipeline without an explicit integration module.

:sparkles: End-to-end, post-processing-free

Mixformer is an end-to-end tracking framework without post-processing.

:sparkles: Strong performance

TrackerVOT2020 (EAO)LaSOT (NP)GOT-10K (AO)TrackingNet (NP)
MixViT-L (ConvMAE)0.56782.8-90.3
MixViT-L0.58482.275.790.2
MixCvT0.55579.970.788.9
ToMP101* (CVPR2022)-79.2-86.4
SBT-large* (CVPR2022)0.529-70.4-
SwinTrack* (Arxiv2021)-78.669.488.2
Sim-L/14* (Arxiv2022)-79.769.887.4
STARK (ICCV2021)0.50577.068.886.9
KeepTrack (ICCV2021)-77.2--
TransT (CVPR2021)0.49573.867.186.7
TrDiMP (CVPR2021)--67.183.3
Siam R-CNN (CVPR2020)-72.264.985.4
TREG (Arxiv2021)-74.166.883.8

Install the environment

Use the Anaconda

conda create -n mixformer python=3.6
conda activate mixformer
bash install_pytorch17.sh

Data Preparation

Put the tracking datasets in ./data. It should look like:

${MixFormer_ROOT}
 -- data
     -- lasot
         |-- airplane
         |-- basketball
         |-- bear
         ...
     -- got10k
         |-- test
         |-- train
         |-- val
     -- coco
         |-- annotations
         |-- train2017
     -- trackingnet
         |-- TRAIN_0
         |-- TRAIN_1
         ...
         |-- TRAIN_11
         |-- TEST

Set project paths

Run the following command to set paths for this project

python tracking/create_default_local_file.py --workspace_dir . --data_dir ./data --save_dir .

After running this command, you can also modify paths by editing these two files

lib/train/admin/local.py  # paths about training
lib/test/evaluation/local.py  # paths about testing

Train MixFormer

Training with multiple GPUs using DDP. More details of other training settings can be found at tracking/train_mixformer_[cvt/vit/convmae].sh for different backbone respectively.

# MixFormer with CVT backbone
bash tracking/train_mixformer_cvt.sh

# MixFormer with ViT backbone
bash tracking/train_mixformer_vit.sh

# MixFormer with ConvMAE backbone
bash tracking/train_mixformer_convmae.sh

Test and evaluate MixFormer on benchmarks

bash tracking/test_mixformer_cvt.sh
bash tracking/test_mixformer_vit.sh
bash tracking/test_mixformer_convmae.sh
cd external/vot20/<workspace_dir>
vot evaluate --workspace . MixFormerPython
# generating analysis results
vot analysis --workspace . --nocache

Run MixFormer on your own video

bash tracking/run_video_demo.sh

Compute FLOPs/Params and test speed

bash tracking/profile_mixformer.sh

Visualize attention maps

bash tracking/vis_mixformer_attn.sh

vis_attn

Model Zoo and raw results

The trained models and the raw tracking results are provided in the [Models and Raw results] (Google Driver) or [Models and Raw results] (Baidu Driver: hmuv).

Contact

Yutao Cui: cuiyutao@smail.nju.edu.cn

Acknowledgments

✏️ Citation

If you think this project is helpful, please feel free to leave a star⭐️ and cite our paper:

@inproceedings{cui2022mixformer,
  title={Mixformer: End-to-end tracking with iterative mixed attention},
  author={Cui, Yutao and Jiang, Cheng and Wang, Limin and Wu, Gangshan},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={13608--13618},
  year={2022}
}
@ARTICLE{cui2023mixformer,
      journal={IEEE Transactions on Pattern Analysis and Machine Intelligence}, 
      title={MixFormer: End-to-End Tracking with Iterative Mixed Attention}, 
      author={Yutao Cui and Cheng Jiang and Gangshan Wu and Limin Wang},
      year={2024}
}