YOLOv5-face provides a high-accuracy, real-time face detection solution. It targets researchers and developers needing efficient face detection capabilities, offering various YOLOv5 model sizes optimized for different performance and accuracy trade-offs.
How It Works
This project adapts the YOLOv5 architecture for face detection, leveraging its efficient single-stage detection framework. It incorporates specific optimizations and training strategies tailored for facial features, achieving competitive performance on benchmarks like WIDERFace. The project also provides pre-trained models and conversion scripts for deployment across different platforms.
Quick Start & Requirements
- Install: Clone the repository and install dependencies via
pip install -r requirements.txt
.
- Prerequisites: Python 3.8+, PyTorch 1.7+, CUDA (for GPU acceleration).
- Data Preparation: Requires WIDERFace dataset and conversion scripts (
train2yolo.py
, val2yolo.py
).
- Training:
CUDA_VISIBLE_DEVICES="..." python3 train.py --data data/widerface.yaml --cfg models/yolov5s.yaml --weights 'pretrained models'
- Evaluation:
python3 test_widerface.py --weights 'your test model' --img-size 640
- Links: YOLOv5-face GitHub
Highlighted Details
- Achieves high accuracy on WIDERFace dataset across Easy, Medium, and Hard splits, with models like YOLOv5s reaching 94.33% Easy, 92.61% Medium, and 83.15% Hard.
- Offers a range of model sizes (n, s, m, l) with varying parameter counts and FLOPs, enabling selection based on hardware constraints.
- Supports conversion to TensorRT, ONNX, NCNN, MNN, and TNN for efficient deployment on various platforms, including Android.
- Includes landmark detection capabilities and has been used in challenges like ICCV2021 Masked Face Recognition.
Maintenance & Community
- The project has seen recent updates, including support for YOLOv8-face and ncnn-android-yolov8-face.
- A QQ group (1164802745) is available for community support.
Licensing & Compatibility
- The repository is licensed under the MIT License, permitting commercial use and integration with closed-source projects.
Limitations & Caveats
- While offering various model sizes, the README does not explicitly detail the performance trade-offs for each on specific hardware.
- Some pre-trained model links point to Baidu Netdisk, which may have regional access limitations.