try to used TransFG to do the Fine-grained Recognition
Official PyTorch code for the paper: TransFG: A Transformer Architecture for Fine-grained Recognition
Implementation based on DeiT pretrained on ImageNet-1K with distillation fine-tuning will be released soon.
- Python 3.7.3
- PyTorch 1.5.1
- torchvision 0.6.1
- ml_collections
To reproduce the submission, do the following step:
Install dependencies with the following command:
pip3 install -r requirements.txt
Please download the model and put it into the output
folder
python inference.py --test_img_path {testing image path} --pretrained_model_path {TransFG pretrained model path, default is in "output"}
If you find our work helpful in your research, please cite it as:
@article{he2021transfg,
title={TransFG: A Transformer Architecture for Fine-grained Recognition},
author={He, Ju and Chen, Jieneng and Liu, Shuai and Kortylewski, Adam and Yang, Cheng and Bai, Yutong and Wang, Changhu and Yuille, Alan},
journal={arXiv preprint arXiv:2103.07976},
year={2021}
}
Many thanks to ViT-pytorch for the PyTorch reimplementation of An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale