Face detection with OpenCV and deep learning - PyImageSearch
face-detectionopencvdeep-learningcomputer-visionpython
Abstraction: OpenCV hidden deep learning SSD-ResNet face detector usage
Key points:
- OpenCV ships a "hidden" DNN-based face detector since version 3.3, using SSD framework with ResNet base network (not MobileNet)
- Model requires two Caffe files: a
.prototxtarchitecture file and a.caffemodelweights file (res10_300x300_ssd_iter_140000.caffemodel) - Input images are preprocessed into 300x300 blobs with mean subtraction
(104.0, 177.0, 123.0)viacv2.dnn.blobFromImage - Outperforms Haar cascades significantly: detects faces at angles and in challenging lighting (e.g., 86.81% confidence in dark venue)
- Works for both static images and live video streams; real-time capable unlike dlib's CNN detector without GPU
- Alternative detectors compared: Haar cascades (fastest but least accurate), dlib HOG/CNN, and MTCNN
Connections: Opencv · Face Detection · Object Detection
Source: https://www.pyimagesearch.com/2018/02/26/face-detection-with-opencv-and-deep-learning/