Uses the hidden deep learning based pre-trained face detector in OpenCV.
Performed face detection on images and videos.
All thanks to Adrian Rosebrock (from pyimagesearch) for making great tutorials. This project is inspired from his blog Face detection with OpenCV and deep learning
- Used deep learning based face detector instead of Haar cascades based face detection, hence it's much more accurate
- The OpenCV deep learning face detector is based on Single Shot Detector (SSD) with a Resnet base network.
- This is a Caffe based face detector which can be found in dnn samples in OpenCV.
- Performed face detection on images as well as on video stream. Code files of both are included.
- I've also put the model architecture file (deploy.prototxt.txt) and trained weights (res10_300x300_ssd_iter_140000.caffemodel)
- python (3.7.1)
- opencv (4.1.0)
- numpy (1.61.2)
- imutils (0.5.2)
For face detection in image:
python detect_image.py --prototxt deploy.prototxt.txt \
--model res10_300x300_ssd_iter_140000.caffemodel \
--image assets/image1.jpg
For face detection in video stream:
python detect_video.py --prototxt deploy.prototxt.txt \
--model res10_300x300_ssd_iter_140000.caffemodel
The performance was really great.
input
Output
input
output
Unfortunately, this detector didn't worked when i passed an image with large number of faces
input
output





