jhb86253817 / tf-re-id

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Person Re-Identification in TensorFlow

This is code of the paper "Deep Person Re-Identification with Improved Embedding and Efficient Training".

Datasets

Environment

  • Ubuntu or Windows
  • TensorFlow v1.0
  • Python 2.7 or 3.5
  • Numpy, Matplotlib, Pillow

Train Model

  1. git clone the repo
  2. 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".
  3. Go to folder "utils", run python preprocess_cuhk01.py to resize cuhk01 data to 128 x 48. Run python preprocess_market.py to resize market1501 data to 128 x 48. Other datasets are 128 x 48 originally.
  4. 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, then python 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 in main.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.

About


Languages

Language:Python 100.0%