Home

Awesome

Python >=3.6 PyTorch >=1.7

Self-Supervised Pre-Training for Transformer-Based Person Re-Identification [pdf]

The official repository for Self-Supervised Pre-Training for Transformer-Based Person Re-Identification.

Requirements

Installation

pip install -r requirements.txt

We recommend to use /torch=1.7.1 /torchvision=0.8.2 /timm=0.3.4 /cuda>10.1 /faiss-gpu=1.7.1/ 16G or 32G V100 for training and evaluation. If you find some packages are missing, please install them manually. You can refer to DINO, TransReID and cluster-contrast-reid to install the environment of pre-training, supervised ReID and unsupervised ReID, respectively.

Prepare Datasets

mkdir data

Download the datasets:

Then unzip them and rename them under the directory like

data
├── market1501
│   └── bounding_box_train
│   └── bounding_box_test
│   └── ..
├── MSMT17
│   └── train
│   └── test
│   └── ..
└── LUP
    └── images 
    └── CFS_list.pkl 

Pre-trained Models

ModelDownload
ViT-S/16link
ViT-S/16+ICSlink
ViT-B/16+ICSlink

Please download pre-trained models and put them into your custom file path.

ReID performance

We have reproduced the performance to verify the reproducibility. The reproduced results may have a gap of about 0.1~0.2% with the numbers in the paper.

Supervised ReID

Market-1501
ModelImage SizePaperReproduceDownload
ViT-S/16256*12891.0/96.091.2/95.8model / log
ViT-S/16+ICS256*12891.3/96.291.4/96.2model / log
ViT-B/16+ICS384*12893.2/96.793.1/96.6model / log
MSMT17
ModelImage SizePaperReproduceDownload
ViT-S/16256*12866.1/84.666.3/84.8model / log
ViT-S/16+ICS256*12868.1/86.168.3/86.2model / log
ViT-B/16+ICS384*12875.0/89.675.1/89.6model / log

USL ReID

Market-1501
ModelImage SizePaperReproduceDownload
ViT-S/16256*12888.2/94.288.4/94.6model / log
ViT-S/16+ICS256*12889.6/95.389.5/95.3model / log
MSMT17
ModelImage SizePaperReproduceDownload
ViT-S/16256*12840.9/66.440.9/66.4model / log
ViT-S/16+ICS256*12850.6/75.050.6/75.0model / log

UDA ReID

MSMT2Market
ModelImage SizePaperReproduceDownload
ViT-S/16256*12889.4/95.489.2/95.3model / log
ViT-S/16+ICS256*12889.9/95.589.9/95.4model / log
Market2MSMT
ModelImage SizePaperReproduceDownload
ViT-S/16256*12847.4/70.847.7/71.2model / log
ViT-S/16+ICS256*12857.8/79.557.8/79.4model / log

Acknowledgment

Our implementation is mainly based on the following codebases. We gratefully thank the authors for their wonderful works.

LUPerson, DINO, TransReID, cluster-contrast-reid.

Citation

If you find this code useful for your research, please cite our paper

@article{luo2021self,
  title={Self-Supervised Pre-Training for Transformer-Based Person Re-Identification},
  author={Luo, Hao and Wang, Pichao and Xu, Yi and Ding, Feng and Zhou, Yanxin and Wang, Fan and Li, Hao and Jin, Rong},
  journal={arXiv preprint arXiv:2111.12084},
  year={2021}
}

Contact

If you have any question, please feel free to contact us. E-mail: michuan.lh@alibaba-inc.com or haoluocsc@zju.edu.cn