This project implements paper Adversarially Occluded Samples for Person Re-identification using pytorch.
- Python 2.7 (Recommend to use Anaconda for easy package management.)
- Pytorch 0.3
The other packages and versions are listed in requirements.txt
. You can install them by pip install -r requirements.txt
.
Create directory dataset
under the project directory, then place datasets in it, as follows.
${project_dir}/dataset
market1501
Market-1501-v15.09.15 # Extracted from Market-1501-v15.09.15.zip, http://www.liangzheng.org/Project/project_reid.html
cuhk03
cuhk03-np # Extracted from cuhk03-np.zip, https://pan.baidu.com/s/1RNvebTccjmmj1ig-LVjw7A
duke
DukeMTMC-reID # Extracted from DukeMTMC-reID.zip, https://github.com/layumi/DukeMTMC-reID_evaluation
Then run following command to transform datasets.
python script/dataset/transform_market1501.py
python script/dataset/transform_cuhk03.py
python script/dataset/transform_duke.py
To train Baseline
on Market1501, with GPU 0, run
bash script/experiment/train.sh Baseline market1501 0
To apply sliding window occlusion with the trained Baseline
model and obtain recognition probability, for Market1501, with GPU 0, run
bash script/experiment/sw_occlude.sh market1501 0
To re-train the model on Market1501 with original and occluded images, with GPU 0, run
bash script/experiment/train.sh OCCLUSION_TYPE market1501 0
where OCCLUSION_TYPE
should be set to No-Adversary
, Random
, Hard-1
, or Sampling
.
If you find our work useful, please kindly cite our paper:
@inproceedings{huang2018adversarially,
title={Adversarially Occluded Samples for Person Re-Identification},
author={Huang, Houjing and Li, Dangwei and Zhang, Zhang and Chen, Xiaotang and Huang, Kaiqi},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={5098--5107},
year={2018}
}