This repo includes the code for Single Camera Training for Person Re-identification. In utils/loss.py, the proposed loss term, Multi-camera Negative Loss, is implemented in class DistanceLoss. We also provide training data (Duke-SCT and Market-SCT in paper) information in duke_sct.txt and market_sct.txt.
The code is based on Cysu/open-reid.
The code has been tested on Pytorch 1.0.0 and Python 3.7.
Other required packages: fire, protobuf, tensorboardX.
We use ResNet-50 as the backbone. A pretrained model file is needed. Please put this file in the repo directory.
1. Download Market-1501 and DukeMTMC-reID
2. Make new directories in data and organize them as follows:
+-- data | +-- market | +-- bounding_box_train_sct | +-- query | +-- boudning_box_test | +-- duke | +-- bounding_box_train_sct | +-- query | +-- boudning_box_test
3. Copy images to the above directories.
Training images used for SCT datasets are listed in market_sct.txt and duke_sct.txt. Query and gallery images remain the same.
To train with our proposed MCNL or Triplet baseline, simply run train.sh.
If you find this code useful, please kindly cite the following paper:
@inproceedings{zhang2020single,
title={Single Camera Training for Person Re-identification},
author={Zhang, Tianyu and Xie, Lingxi and Wei, Longhui and Zhang, Yongfei and Li, Bo and Tian, Qi},
booktitle={AAAI Conference on Artificial Intelligence (AAAI)},
year={2020}
}