Python Cuda JavaScript Shell HTML CSS Other
Switch branches/tags
Nothing to show
Clone or download
Cysu Update
Fix a typo in comment
Latest commit e36a3d9 May 30, 2017
Failed to load latest commit information.
caffe @ aed3884 Update caffe Dec 20, 2016
data Remove unused scripts Dec 20, 2016
demo Add demo images Apr 16, 2017
experiments Strip unused files Feb 19, 2017
lib Update May 30, 2017
models Strip unused files Feb 19, 2017
tools Add README Apr 16, 2017
vis Sketch a visualization page Feb 19, 2017
.gitignore Ignore demo results Apr 16, 2017
.gitmodules Git submodule for caffe Oct 23, 2016
LICENSE First commit Apr 28, 2016 Add README Apr 16, 2017
demo.jpg Add README Apr 16, 2017
vis.jpg Update README Feb 24, 2017

Person Search Project

This repository hosts the code for our paper Joint Detection and Identification Feature Learning for Person Search. The code is modified from the py-faster-rcnn written by Ross Girshick.


  1. Clone this repo recursively
git clone --recursive
  1. Build Caffe with python layers and interface

We modified caffe based on Yuanjun's fork, which supports multi-gpu and memory optimization.

Apart from the official installation prerequisites, we have several other dependencies:

  • cudnn-v5.1
  • 1.7.4 < openmpi < 2.0.0
  • boost >= 1.55 (A tip for Ubuntu 14.04: sudo apt-get autoremove libboost1.54* then sudo apt-get install libboost1.55-all-dev)

Then compile and install the caffe with

cd caffe
mkdir build && cd build
cmake .. -DUSE_MPI=ON -DCUDNN_INCLUDE=/path/to/cudnn/include -DCUDNN_LIBRARY=/path/to/cudnn/lib64/
make -j8 && make install
cd ../..

Please refer to this page for detailed installation instructions and troubleshooting.

  1. Build the Cython modules

Install some Python packages you might not have: Cython, python-opencv, easydict (>=1.6), PyYAML, protobuf, mpi4py. Then

cd lib && make && cd ..


Download our trained model to output/psdb_train/resnet50/, then

python2 tools/ --gpu 0

Or you can use CPU only by setting --gpu -1.



  1. Request the dataset from sli [at] or xiaotong [at] (academic only). Then
experiments/scripts/ /path/to/the/downloaded/
  1. Download an ImageNet pretrained ResNet-50 model to data/imagenet_models.

  2. Training with GPU=0

experiments/scripts/ 0 --set EXP_DIR resnet50

It will finish in around 18 hours, or you may directly download a trained model to output/psdb_train/resnet50/

  1. Evaluation

    By default we use 8 GPUs for faster evaluation. Please adjust the experiments/scripts/ with your hardware settings. For example, to use only one GPU, remove the mpirun -n 8 in L14 and change L16 to --gpu 0.

    experiments/scripts/ resnet50 50000 resnet50

    The result should be around

    search ranking:
      mAP = 75.47%
      top- 1 = 78.62%
      top- 5 = 90.24%
      top-10 = 92.38%
  2. Visualization

    The evaluation will also produce a json file output/psdb_test/resnet50/resnet50_iter_50000/results.json for visualization. Just copy it to vis/ and run python2 -m SimpleHTTPServer. Then open a browser and go to http://localhost:8000/vis.

    Visualization Webpage


  title={Joint Detection and Identification Feature Learning for Person Search},
  author={Xiao, Tong and Li, Shuang and Wang, Bochao and Lin, Liang and Wang, Xiaogang},

Repo History

The first version of our paper was published in 2016. We have made substantial improvements since then and published a new version of paper in 2017. The original code was moved to branch v1 and the new code has been merged to master. If you have checked out our code before, please be careful on this and we recommend clone recursively into a new repo instead.