The YOLOv3 (You Only Look Once) is a state-of-the-art, real-time object detection algorithm. The published model recognizes 80 different objects in images and videos. For more details, you can refer to this paper.
Credit: Ayoosh Kathuria
OpenCV dnn
module supports running inference on pre-trained deep learning models from popular frameworks such as TensorFlow, Torch, Darknet and Caffe.
- tensorflow
- opencv-python
- opencv-contrib-python
- numpy
Install the required packages by running the following command:
$ pip install -r requirements.txt
Note: This repositoty works on Python 3.x. Using Python virtual environment is highly recommended.
- Clone this repository
$ git clone https://github.com/sthanhng/yoloface
-
For face detection, you should download the pre-trained YOLOv3 weights file which trained on the WIDER FACE: A Face Detection Benchmark dataset from this link and place it in the
model-weights/
directory. -
Run the following command:
image input
$ python yoloface.py --images samples/outside_000001.jpg --output-dir outputs/
video input
$ python yoloface.py --video samples/subway.mp4 --output-dir outputs/
webcam
$ python yoloface.py --src 1 --output-dir outputs/
This project is licensed under the MIT License - see the LICENSE.md file for more details.