Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



  • Python 2.7
  • GPU Memory >= 6G
  • Numpy
  • Pytorch 0.4.1

Getting started


git clone
cd vision
python install

Because pytorch and torchvision are ongoing projects.

Dataset & Preparation

Download Market1501 Dataset,CUHK03,DukeMTMC

Preparation: Put the images with the same id in one folder. You may use


Remember to change the dataset path to your own path.


Train a model by

python --gpu_ids 0 --name model1 --train_all --batchsize 32  --data_dir your_data_path --weight 0.2

--gpu_ids which gpu to run.

--name the name of model.

--data_dir the path of the training data.

--baseline without using the RLD.

--train_all using all images to train.

--batchsize batch size.

--erasing_p random erasing probability.

--weight for two training loss weighting.

Train a model with random erasing by

python --gpu_ids 0 --name model1 --train_all --batchsize 32  --data_dir your_data_path --weight 0.2 --erasing_p 0.5


Use trained model to extract feature by

python --gpu_ids 0 --name model1 --test_dir your_data_path  --which_epoch 59 --dataset_name market

--gpu_ids which gpu to run.

--name the dir name of trained model.

--which_epoch select the i-th model.

--test_dir the path of the testing data.

--dataset_name the name of the testing dataset.


python --mat-path model1

--mat-path the dir name of trained model.

It will output Rank@1, Rank@5, Rank@10 and mAP results.

For mAP calculation, you also can refer to the C++ code for Oxford Building. We use the triangle mAP calculation (consistent with the Market1501 original code).


The baseline has been well-trained in repository.


Our codes are mainly based on this repository

If you use this code, please kindly cite it in your paper

  title={Discovering Underlying Person Structure Pattern with Relative Local Distance for Person Re-identification},
  author={Wang, Guangcong and Lai, Jianhuang and Xie, Zhenyu and Xie, Xiaohua},
  journal={arXiv preprint arXiv:1901.10100},
You can’t perform that action at this time.