This is code of the paper "Deep Person Re-Identification with Improved Embedding and Efficient Training".
- cuhk03
- cuhk01
- viper
- market1501(for pre-training, v15.09.15 is used in this paper)
- Ubuntu or Windows
- TensorFlow v1.0
- Python 2.7 or 3.5
- Numpy, Matplotlib, Pillow
- git clone the repo
- Make a directory named "images" under "tf-re-id". Download the datasets, and put them under "images". For cuhk03, the directory name should be "cuhk03", its subfolder should be "All_128x48" where it contains two folders "detected" and "labeled". For cuhk01, the directory name should be "cuhk01", and it contains two folders "cam1" and "cam2". For viper, the directory name should be "VIPeR", and it contains two folders "cam_a" and "cam_b". For market1501, its folder name should be "Market1501", and it should have three subfolders "bounding_box_train", "bounding_box_test", and "query". For more details of the data format, please refer to the folder "images_fake".
- Go to folder "utils", run
python preprocess_cuhk01.py
to resize cuhk01 data to 128 x 48. Runpython preprocess_market.py
to resize market1501 data to 128 x 48. Other datasets are 128 x 48 originally. - Go to folder "code", run
main.py
to start training. You need to specify arguments for training, which includes the name of the data, the CNN architecture, the seed of running. For example, if you want to run the CNN with center loss and FRW layer on cuhk03 in seed 1, thenpython main.py -cuhk03 -cnn-frw-ic -1
. When training is done, the result on test data will be given. For more details, please see the usage information inmain.py
.
Note that although the random seeds have been fixed, the results are not exactly reproducible because there is still randomness from GPU. However, the randomness is small.