This repo contains the official PyTorch implementation for the CVPR 2022 Oral paper: 'Few-Shot Object Detection with Fully Cross-Transformer' (paper).
Our codebase is built upon detectron2. You only need to install detectron2 following their instructions.
Please note that we used detectron 0.2.1 in this project. Higher versions of detectron might report errors.
The script is
python build_pvt_C4_from_official_model.py
We use the converted model pvt_v2_b2_li_C4.pth by default next.
sh scripts/single_branch_pretraining_coco_pvt_v2_b2_li.sh
sh scripts/two_branch_training_coco_pvt_v2_b2_li.sh
sh scripts/two_branch_few_shot_finetuning_coco_pvt_v2_b2_li.sh
sh scripts/single_branch_pretraining_pascalvoc_split1_pvt_v2_b2_li.sh
sh scripts/two_branch_training_pascalvoc_split1_pvt_v2_b2_li.sh
sh scripts/two_branch_few_shot_finetuning_pascalvoc_split1_pvt_v2_b2_li.sh
sh scripts/single_branch_pretraining_pascalvoc_split2_pvt_v2_b2_li.sh
sh scripts/two_branch_training_pascalvoc_split2_pvt_v2_b2_li.sh
sh scripts/two_branch_few_shot_finetuning_pascalvoc_split2_pvt_v2_b2_li.sh
sh scripts/single_branch_pretraining_pascalvoc_split3_pvt_v2_b2_li.sh
sh scripts/two_branch_training_pascalvoc_split3_pvt_v2_b2_li.sh
sh scripts/two_branch_few_shot_finetuning_pascalvoc_split3_pvt_v2_b2_li.sh
We provided both the single-branch pre-trained models and the meta-trained models (the two-branch based models) over base classes for both MSCOCO dataset and the 3 splits on VOC dataset. The model links are Google Drive and Tencent Weiyun.
If you use this work in your research or wish to refer to the baseline results published here, please use the following BibTeX entries:
@inproceedings{han2022few,
title={Few-shot object detection with fully cross-transformer},
author={Han, Guangxing and Ma, Jiawei and Huang, Shiyuan and Chen, Long and Chang, Shih-Fu},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={5321--5330},
year={2022}
}
@inproceedings{han2022meta,
title={Meta faster r-cnn: Towards accurate few-shot object detection with attentive feature alignment},
author={Han, Guangxing and Huang, Shiyuan and Ma, Jiawei and He, Yicheng and Chang, Shih-Fu},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
volume={36},
number={1},
pages={780--789},
year={2022}
}
@inproceedings{han2021query,
title={Query adaptive few-shot object detection with heterogeneous graph convolutional networks},
author={Han, Guangxing and He, Yicheng and Huang, Shiyuan and Ma, Jiawei and Chang, Shih-Fu},
booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
pages={3263--3272},
year={2021}
}
This repo is developed based on Meta Faster R-CNN, QA-FewDet and PVT. Thanks for their wonderful codebases.