Skip to content

agusgun/person-reid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Person Re-identification using Face Biometric Feature

The README has been updated. Please contact me or make an issue on this repository if you have any problem to install/reproduce the experiment.

How to Install Dependency and Run The Program

Requirements

  1. Darknet need to be installed (Refer to the source section)

Install Dependency

  1. [Optional] Create new conda environment (to make fbs command run smoothly)
conda create -n <NAME OF YOUR ENVIRONMENT> python=3
  1. Install pip requirement
pip install -r requirements.txt
  1. [Optional] Install opencv-python using conda command (if there is an error about opencv not found)
conda install -c conda-forge opencv
  1. [Optional-GPU] Install yolo34py using pip (yolo34py is a wrapper of darknet so YOLO model can be run on GPU)
pip install yolo34py-gpu

NB: This wrapper doesn't support MacOS

  1. Install tensorflow-gpu (or tensorflow if you don't have GPU) and keras on the environment
conda install -n <NAME OF YOUR NEW CONDA ENVIRONMENT> tensorflow keras
  1. Install keras_vggface (if there is a problem keras_application then fix it manually -> edit site-packages)
pip install keras_vggface
  1. Install facerec from bytefish repository
git clone https://github.com/bytefish/facerec
cd py
python setup.py install
  1. Install mtcnn
pip install mtcnn
  1. Export some environment variable
    • GPU environment variable to know whether you have GPU or not
      1. Only CPU: EXPORT USE_GPU=
      2. GPU support: EXPORT USE_GPU=1 (GPU boost and Linux tested)
    • There are 2 versions of the system. The first is the full system that used all the pipeline meanwhile, the second only used face detection and re-identification.
      1. Full system: EXPORT PERSON_REID_DIRECT_REIDENTIFICATION=
      2. Partial system (faster): EXPORT PERSON_REID_DIRECT_REIDENTIFICATION=1

How to Run the Experiment

  1. Install jupyter notebook on the environment
  2. Install the dependency
  3. Pick one of the notebook
  4. Run all the cell of the notebook
  5. Please make an issue if there is any problem

Source

Detection

Install Darknet

Install YOLOv3 Darknet using this link

Change Makefile

Change the Makefile before installation using make: GPU=1, CUDNN=1, OPENCV=1[Optional], OPENMP=1, and LIBSO=1

Create symlink

Create symlink using this command:
sudo ln -s <DARKNET HOME DIRECTORY WITH .SO FILE> /usr/lib/x86_64-linux-gnu/libdarknet.so

Install Wrapper

  1. Clone the wrapper: git clone https://github.com/madhawav/YOLO3-4-Py
  2. Export CUDA_HOME path: EXPORT CUDA_HOME=<CUDA_HOME_PATH>
  3. Export GPU option: EXPORT GPU=1
  4. Export OpenCV option: EXPORT OPENCV=1 [For this, install OpenCV first using the link given by README of the file]
  5. Go to the root directory of the yolo34py and install using pip
  • Install manually
cd YOLO3-4-Py
pip install .
  • Install using pypi project
pip install yolo34py

Detection

Tracking

Keyframe Extraction

Face

Detection

Facial Landmark Extraction

Keyframe Extraction

Using thresholding on face tilt angle (can be measured using slope between two eyes position)

Re-identification

Please download the model weight from each link above and place it on model_data directory.

Thesis Progress

  • Threading Input
  • Detection
  • Tracking
  • Detection & Tracking Threading
  • Keyframe Extraction
  • Re-identification Threading
  • Face Recognition (Re-identification Face)

Source and Tutorial