A lightweight face detector with keypoint detection built for mobile deployment. The model starts from RetinaFace-MobileNet-0.25 and is converted to ncnn, OpenCV ONNX and PyTorch — a slim detector that holds up on edge hardware.
What it does
- Face-Detector-1MB slim with 5 facial keypoints.
- RetinaFace-MobileNet-0.25 exported to ncnn, ONNX and PyTorch.
- Parameter count and FLOP calculation built in, for optimising against a hardware budget.
- Modified anchor sizes tuned for mobile and edge devices.
- A reimplementation of Face-Detector-1MB that adds keypoint detection and ncnn C++ deployment.
- Higher accuracy than the original models, fast enough for real-time use.
Stack
- Ubuntu 18.04 · Python 3.7
- PyTorch, OpenCV, NumPy
- ncnn (C++ inference), ONNX Runtime
Accuracy on WIDER FACE
Single-scale input, 320×240
| Method | Easy | Medium | Hard |
|---|---|---|---|
| libfacedetection v1 (caffe) | 0.650 | 0.500 | 0.233 |
| libfacedetection v2 (caffe) | 0.714 | 0.585 | 0.306 |
| version-slim (original) | 0.765 | 0.662 | 0.385 |
| version-RFB (original) | 0.784 | 0.688 | 0.418 |
| version-slim (ours) | 0.795 | 0.683 | 0.345 |
| version-RFB (ours) | 0.814 | 0.710 | 0.363 |
| RetinaFace-MobileNet-0.25 (ours) | 0.811 | 0.697 | 0.376 |
Single-scale input, 640×480
| Method | Easy | Medium | Hard |
|---|---|---|---|
| libfacedetection v1 (caffe) | 0.741 | 0.683 | 0.421 |
| libfacedetection v2 (caffe) | 0.773 | 0.718 | 0.485 |
| version-slim (original) | 0.757 | 0.721 | 0.511 |
| version-RFB (original) | 0.851 | 0.810 | 0.541 |
| version-slim (ours) | 0.850 | 0.808 | 0.595 |
| version-RFB (ours) | 0.865 | 0.828 | 0.622 |
| RetinaFace-MobileNet-0.25 (ours) | 0.873 | 0.836 | 0.638 |
When testing, the long side is either 320 or 640 and the image is scaled in equal proportions.