List of important approaches:
-
Viola-Jones Detector (CVPR, 2001)
- Available in OpenCV
- A tutorial can be found here: https://docs.opencv.org/3.4/db/d28/tutorial_cascade_classifier.html
-
MTCNN (2016)
- Original code: https://github.com/kpzhang93/MTCNN_face_detection_alignment
- The model was originally developed in Caffe
- Repository with OpenCV and C++: https://github.com/ksachdeva/opencv-mtcnn
- Repository with OpenCV and Python: https://github.com/linxiaohui/mtcnn-opencv
-
SSD (ECCV, 2016)
- The official code repository is here: https://github.com/weiliu89/caffe/tree/ssd
- OpenCV integrates a pretrained model that can be found here: https://github.com/opencv/opencv/tree/master/samples/dnn/face_detector
- Instructions how the SSD model was trained are also in the OpenCV repository
- The weights probably stem from this repository: https://github.com/sr6033/face-detection-with-OpenCV-and-DNN
-
RetinaFace (CVPR, 2020)
- RetinaFace is originally trained in MXNet and the code can be found here: https://github.com/deepinsight/insightface/tree/master/detection/retinaface
- For usage in inference, I would use this repository: https://github.com/Charrin/RetinaFace-Cpp
- The Caffe model can probably be loaded with OpenCV
-
YOLO5-Face (ArXiV, 2022)
- The official code repository is here: https://github.com/deepcam-cn/yolov5-face
- The model is trained on WiderFace dataset with Pytorch
- The YoloV8-Face repository is here: https://github.com/derronqi/yolov8-face/tree/main
- Converted ONNX models for yolov8 can be found here: https://github.com/hpc203/yolov8-face-landmarks-opencv-dnn
-
Install miniconda
-
Create conda environment with
conda env create -n fdetect -f environment.yml
-
Install pip requirements
conda activate fdetect pip install -r requirements.txt
-
Install pre-commit
pre-commit install
-
Face detection:
python detect_faces.py (-h)
-
Face alignment:
python detect_align.py (-h)
Use -h
flag to show options
- Fix performance discrepancy between
src/mtcnn_onnx.py
andsrc/mtcnn_caffe.py