This project detects objects with Yolo-v3 and tries to recognize objects that are classified as "person" in Yolo.
python3.5+
virtualenv
- 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
- 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
yolov3.py [-h] -i INPUT -o OUTPUT -y YOLO [-c CONFIDENCE] [-n NMS] [-f FACE_EMBEDDINGS]
Exampleyolov3.py -i inputs/harvard.mp4 -o outputs/out -y yolo/
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
This project is licensed under the MIT License - see the LICENSE.md file for details
- I've used InsightFace_Pytorch for face recognition.
- This repo mainly inspired from Adrian Rosebrock's code.