Home

Awesome

imTED: Integrally Migrating Pre-trained Transformer Encoder-decoders for Visual Object Detection

PWC <a href="https://openaccess.thecvf.com/content/ICCV2023/html/Liu_Integrally_Migrating_Pre-trained_Transformer_Encoder-decoders_for_Visual_Object_Detection_ICCV_2023_paper.html"><img src="https://img.shields.io/badge/ICCV2023-Paper-<color>"></a> arXiv

<!-- <div align=center><img src="figs/Framework1.png"></div> --> <div align=center><img src="figs/Framework2.png"></div> <!-- <div align=center><img src="figs/Framework3.png"></div> -->

Code of our ICCV 2023 paper Integrally Migrating Pre-trained Transformer Encoder-decoders for Visual Object Detection. Blog in Chinese is available here.

The code is based on mmdetection, please refer to get_started.md and MMDET_README.md to set up the environment and prepare the data.

Config Files and Performance and Trained Weights

We provide 9 configuration files in the configs directory.

Config FileBackboneEpochsBox APMask APDownload
imted_faster_rcnn_vit_small_3x_cocoViT-S3648.2model
imted_faster_rcnn_vit_base_3x_cocoViT-B3652.9model
imted_faster_rcnn_vit_large_3x_cocoViT-L3655.4model
imted_mask_rcnn_vit_small_3x_cocoViT-S3648.742.7model
imted_mask_rcnn_vit_base_3x_cocoViT-B3653.346.4model
imted_mask_rcnn_vit_large_3x_cocoViT-L3655.548.1model
imted_faster_rcnn_vit_base_2x_base_training_cocoViT-B2450.6model
imted_faster_rcnn_vit_base_2x_finetuning_10shot_cocoViT-B10823.0model
imted_faster_rcnn_vit_base_2x_finetuning_30shot_cocoViT-B10830.4model

MAE Pre-training

The pre-trained model is trained with the official MAE code. For ViT-S, we use a 4-layer decoder with dimension 256 for 800 epochs of pre-training. For ViT-B, we use an 8-layer decoder with dimension 512 for 1600 epochs of pre-training. Pre-trained weights can be downloaded from the official MAE weight. For ViT-L, we use an 8-layer decoder with dimension 512 for 1600 epochs of pre-training. Pre-trained weights can be downloaded from the official MAE weight.

Last Step of Preparation

For all experiments, remember to modify the path of pre-trained weights in the configuration files, e.g. configs/imted/imted_faster_rcnn_vit_small_3x_coco.py.

For few-shot experiments, please refer to FsDet for data preparation. Remember to modify the path of json in the configuration files, e.g. configs/imted/few_shot/imted_faster_rcnn_vit_base_2x_base_training_coco.py. Json files used for few-shot training and evaluation can also be downloaded from here.

Evaluating with 1 GPU

tools/dist_test.sh "path/to/config/file.py" "path/to/trained/weights.pth" 1 --eval bbox

Training with 8 GPUs

tools/dist_train.sh "path/to/config/file.py" 8 

Few-shot Training with 8 GPUs

Base Training

tools/dist_train.sh configs/imted/few_shot/imted_faster_rcnn_vit_base_2x_base_training_coco.py 8 

Finetuning

Replace the the ckeckpoint path of your own checkpoint from base training or just use our provided checkpoint here.

tools/dist_train.sh configs/imted/few_shot/imted_faster_rcnn_vit_base_2x_finetuning_30shot_coco.py 8 

Acknowledgement

This project is based on MAE, mmdetection and timm. Thanks for their wonderful works.

Some works based on imTED

Citation

If you find imTED is useful in your research or applications, please consider giving us a star 🌟 and citing it by the following BibTeX entry.

@inproceedings{liu2023integrally,
  title={Integrally Migrating Pre-trained Transformer Encoder-decoders for Visual Object Detection},
  author={Liu, Feng and Zhang, Xiaosong and Peng, Zhiliang and Guo, Zonghao and Wan, Fang and Ji, Xiangyang and Ye, Qixiang},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={6825--6834},
  year={2023}
}