Compare face detectors - Dlib, OpenCV, Others..
Test image size : HD (720p)
We wanted to check processing time on same condition. but It couldn't becasue each method demand different input size. (ex. opencv dnn use 300x300 bgr image.)
So, Each code has a different image size.
ocv-dnn : 300x300
ocv-haar, dlib-hog, dlib-cnn, fr-hog, fr-cnn : VGA(640x360)
mtcnn : HD(1280x720)
Test on Intel i7-6700K & GTX1080.
ocv-dnn | ocv-haar | dlib-hog | dlib-cnn | fr-hog | fr-cnn | mtcnn |
---|---|---|---|---|---|---|
17.79ms | 42.31ms | 108.61ms | 42.17ms | 108.50ms | 39.91ms | 334.38ms |
Test on MacBook pro retina 2014 mid.
ocv-dnn | ocv-haar | dlib-hog | dlib-cnn | fr-hog | fr-cnn | mtcnn |
---|---|---|---|---|---|---|
46.53ms | 88.47ms | 174.81ms | 3276.62ms | 174.63ms | 3645.53ms | 928.752ms |
- Python 3.6
- OpenCV 3.4.0 (option: build from src with highgui)
- Dlib 19.10.0
- face_recognition 1.2.1
- pytorch 0.3.1
First, install libs
pip install opencv-contrib-python
pip install torch
pip install dlib
pip install face_recognition
Second, check run-time for each algorithm.
./run.sh
Of course, You can execute each file. and watch the result image (need opencv high gui)
python dlib-hog.py
opencv haar cascade
opencv caffe based dnn (res-ssd)
dlib hog
dlib cnn
face-recognition (dlib-based)
mtcnn