This is the official PyTorch implementation of the CVPR 2021 paper Joint Generative and Contrastive Learning for Unsupervised Person Re-identification.
Requirements
- Python 3.6
- Pytorch 1.2.0
git clone https://github.com/chenhao2345/GCL
cd GCL
python setup.py develop
cd examples && mkdir data
Download the raw datasets DukeMTMC-reID, Market-1501, MSMT17, and then unzip them under the directory like
GCL/examples/data
├── dukemtmc-reid
│ └── DukeMTMC-reID
├── market1501
└── msmt17
└── MSMT17_V1(or MSMT17_V2)
Download our extracted meshes from Google Drive. Unzip them under the directory like
GCL/examples/mesh
├── dukeMTMC
├── market
└── msmt17
Or refer to HMR ro get meshes for ReID datasets.
Only support 1 GPU (GPU memory > 20GB) training for the moment.
Train a ResNet50 with an unsupervised method, for example, JVTC(or download our trained models from Google Drive) and MLC.
GCL/examples/logs
└── JVTC
└── market
└── resnet50_market075_epoch00045.pth
└── duke
└── resnet50_duke075_epoch00040.pth
Adjust path for dataset, mesh, pre-trained identity encoder.
sh train_stage2_market.sh
sh train_stage3_market.sh
For example,
tensorboard --logdir logs/market_init_JVTC_unsupervised/
For example,
tensorboard --logdir logs/market_init_JVTC_unsupervised/stage3/
@InProceedings{Chen_2021_CVPR,
author = {Chen, Hao and Wang, Yaohui and Lagadec, Benoit and Dantcheva, Antitza and Bremond, Francois},
title = {Joint Generative and Contrastive Learning for Unsupervised Person Re-Identification},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
month = {June},
year = {2021},
pages = {2004-2013}
}