The official repository for Dynamic Clustering and Cluster Contrastive Learning for Unsupervised Person Re-ID with Feature Distribution Alignment achieves state-of-the-art performances on 3 commonly used person re-ID including MSMT17, Market-1501 and DukeMTMC.
[2023-12-14] Our work has been accepted by ICASSP 2024!
pip install -r requirements.txt
python setup.py develop
cd examples && mkdir data
Download the person datasets Market-1501, MSMT17, and DukeMTMC-reID. Then unzip them under the directory like
DCCC/examples/data
├── market1501
│ └── Market-1501-v15.09.15
├── dukemtmcreid
│ └── DukeMTMC-reID
├── msmt17
│ └── MSMT17_V1
When training with the backbone of IBN-ResNet, you need to download the ImageNet-pretrained model from this link and save it under the path of logs/pretrained/
.
mkdir logs && cd logs
mkdir pretrained
The file tree should be
DCCC/logs
└── pretrained
└── resnet50_ibn_a.pth.tar
ImageNet-pretrained models for ResNet-50 will be automatically downloaded in the python script.
We utilize 4 Telsa V100 GPUs for training. Note that
- use
--iters 200
(default) for datasets; - use
--width 128 --height 256
(default) for person datasets; - use
-a resnet50
(default) for the backbone of ResNet-50, and-a resnet_ibn50a
for the backbone of IBN-ResNet.
To train the model(s) in the paper, run this command:
bash train.sh
We utilize 1 Telsa V100 GPU for testing. Note that
- use
--width 128 --height 256
(default) for person datasets; - use
-a resnet50
(default) for the backbone of ResNet-50, and-a resnet_ibn50a
for the backbone of IBN-ResNet.
To evaluate the model, run:
### Market-1501 ###
CUDA_VISIBLE_DEVICES=0 \
python examples/test.py \
-d market1501 --resume logs/dccc/market_resnet50/model_best.pth.tar
Our DCCC partially refers open-sourced SpCL, we thank their awesome contribution.
If you find this code useful for your research, please cite our paper
@article{He2023DynamicCA,
title={Dynamic Clustering and Cluster Contrastive Learning for Unsupervised Person Re-identification},
author={Ziqi He and Mengjia Xue and Yunhao Du and Zhicheng Zhao and Fei Su},
journal={ArXiv},
year={2023},
volume={abs/2303.06810},
url={https://api.semanticscholar.org/CorpusID:257496756}
}