/Yolov3-Face-Recognition

This project detects objects with Yolo-v3 and tries to recognize objects that are classified as "person" in Yolo.

Primary LanguageJupyter NotebookMIT LicenseMIT

Yolov3-Face-Recognition

This project detects objects with Yolo-v3 and tries to recognize objects that are classified as "person" in Yolo.

Output Sample

Screenshot

Getting Started

Prerequisites

  • python3.5+
  • virtualenv

Download

  • Download YOLOv3 wieghts and copy them into yolo/ folder.
wget https://pjreddie.com/media/files/yolov3.weights
  • Download the cfg/yolov3.cfg and data/coco.names from Darknet and move them to yolo/ folder.
  • Create a virtualenv and install the python packages
virtual env -p python3.5 venv
source venv/bin/activate 
pip install -r requirements.txt

Usage

- Prepare Data
  • Create a folder structure in face_module/data/facebank/ for faces that you want to recognize.
data/facebank/
        ---> id1/
            ---> id1_1.jpg
        ---> id2/
            ---> id2_1.jpg
        ---> id3/
            ---> id3_1.jpg
           ---> id3_2.jpg

- Run

  • yolov3.py [-h] -i INPUT -o OUTPUT -y YOLO [-c CONFIDENCE] [-n NMS] [-f FACE_EMBEDDINGS] Example
  • yolov3.py -i inputs/harvard.mp4 -o outputs/out -y yolo/

Arguments


optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Path to input video
  -o OUTPUT, --output OUTPUT
                        Path to output video
  -y YOLO, --yolo YOLO  Path to YOLO
  -c CONFIDENCE, --confidence CONFIDENCE
                        Confidence threshold
  -n NMS, --nms NMS     Non-maximum suppression threshold
  -f FACE_EMBEDDINGS, --face_embeddings FACE_EMBEDDINGS
                        Prepare a new Face embeddings file or not
  • NMS default 0.4
  • Confidence default 0.5

Built With

License

This project is licensed under the MIT License - see the LICENSE.md file for details

References