How to Set Up the Person Search Project

Nov 28, 2023 | Data Science

If you’re venturing into the domain of person search, you might have stumbled upon the fascinating paper Joint Detection and Identification Feature Learning for Person Search. This guide will walk you through the steps necessary to set up the Person Search Project and ensure it runs smoothly.

Installation Steps

To begin, follow these steps to get the project set up on your machine:

  1. Clone the Repository Recursively
    git clone --recursive https://github.com/ShuangLI59/person_search.git
  2. Build Caffe with Modified Features

    Before diving into this step, ensure you have all standard prerequisites by checking the official Caffe installation guide. Additionally, you’ll need:

    • cuDNN v5.1
    • OpenMPI v2.0.0
    • Boost version 1.55 (For Ubuntu 14.04, run sudo apt-get autoremove libboost1.54* then sudo apt-get install libboost1.55-all-dev)

    Then compile and install Caffe:

    cd caffe
    mkdir build
    cd build
    cmake .. -DUSE_MPI=ON -DCUDNN_INCLUDE=pathtocudnninclude -DCUDNN_LIBRARY=pathtocudnnlib64libcudnn.so
    make -j8
    make install
    cd ..
  3. Build the Cython Modules

    Now, install necessary Python packages if you haven’t yet:

    • Cython
    • python-opencv
    • easydict (version 1.6)
    • PyYAML
    • protobuf
    • mpi4py

    Follow this up with:

    cd lib
    make
    cd ..

Running the Demo

To see the project in action, download our trained model and execute the following command:

python2 tools/demo.py --gpu 0

If you prefer running it on a CPU, simply change --gpu 0 to --gpu -1.

Demo

Conducting Experiments

Get started with your experiments by doing the following:

  1. Request the dataset by contacting tong.xiao.work@gmail.com (this is for academic purposes only).
  2. Prepare the data using:
  3. cd experiments/scripts
    sh prepare_data.sh pathtothedownloadeddataset.zip
  4. Next, download the ImageNet pretrained ResNet-50 model to data/imagenet_models.
  5. Proceed with training:
  6. cd experiments/scripts
    sh train.sh 0 --set EXP_DIR resnet50

    This should wrap up in about 18 hours or you can download a trained model directly.

Evaluating Your Model

For evaluation, it’s best to use 8 GPUs. Adjust your script according to your hardware. For example:

cd experiments/scripts
sh eval_test.sh resnet50 50000 resnet50

You’re likely to get results similar to:

mAP = 75.47%
top-1 = 78.62%
top-5 = 90.24%
top-10 = 92.38%

Visualization of Results

After evaluation, you can visualize the results. Copy the generated .json file:

output/psdb_test/resnet50/resnet50_iter_50000/results.json

Run the following command to set up a simple HTTP server and visualize:

cd vis
python2 -m SimpleHTTPServer

Finally, open your browser and visit http://localhost:8000/vis.

Visualization Webpage

Troubleshooting Tips

If you run into any issues during installation or execution, here are some tips to consider:

  • Ensure all dependencies are correctly installed and that you’re using compatible versions.
  • If encountering execution errors, double-check the paths you’ve set in your commands to ensure they’re accurate.
  • Review any output logs or error messages for hints on what might be going wrong.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

With this setup, you’re now ready to explore the powerful capabilities of the Person Search Project. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox