The YOLOv8-Face repository provides pre-trained models designed specifically for face detection. The models have been pre-trained by Lindevs from scratch.
The models have been trained on WIDERFace dataset using NVIDIA RTX 4090. YOLOv8 models were used as initial weights for training.
| Name | Image Size (pixels) |
mAPval 50-95 |
Params | GFLOPs |
|---|---|---|---|---|
| YOLOv8n-Face | 640 | 37.5 | 3005843 | 8.1 |
| YOLOv8s-Face | 640 | 40.6 | 11125971 | 28.4 |
| YOLOv8m-Face | 640 | 41.7 | 25840339 | 78.7 |
| YOLOv8l-Face | 640 | 42.8 | 43607379 | 164.8 |
| YOLOv8x-Face | 640 | 43.3 | 68124531 | 257.4 |
- Training results:
| Name | Training Time | Epochs | Batch Size | Non-default parameters |
Link |
|---|---|---|---|---|---|
| YOLOv8n-Face | 2.75 hours | 300 | 16 | - | results.txt |
| YOLOv8s-Face | 2.68 hours | 200 | 16 | - | results.txt |
| YOLOv8m-Face | 3.01 hours | 120 | 16 | - | results.txt |
| YOLOv8l-Face | 3.97 hours | 110 | 16 | - | results.txt |
| YOLOv8x-Face | 13.65 hours | 240 | 16 | optimizer='SGD' lrf=1e-5 weight_decay=5e-3 |
results.txt |
- Evaluation results on WIDERFace dataset:
| Name | Easy | Medium | Hard |
|---|---|---|---|
| YOLOv8n-Face | 93.79 | 91.82 | 79.38 |
| YOLOv8s-Face | 95.13 | 93.62 | 82.90 |
| YOLOv8m-Face | 95.73 | 94.47 | 84.55 |
| YOLOv8l-Face | 96.26 | 95.03 | 85.43 |
| YOLOv8x-Face | 96.33 | 95.16 | 85.80 |
-
"Edit configuration" before starting a Jupyter notebook:
- Memory: 10000 (MB), CPUs: 1, GPU: 1
-
Start the notebook with the environment 'yolo8'
-
Create a console in Jupyter and run the following
bash
cd yolov8-face
python predictsave.py --weights weights/yolov8n-face-lindevs.pt --source data/images/bus.jpgNow check in the 'results' directory for your bus png file with detected faces
Create feature groups for all training images
1-create-feature-groups.ipynbCreate the training/test split and fine tune the pretrained model
2-fine-tune.ipynbNow check in the model registry for your trained model
You need to set the following environment variables
- HOPSWORKS_HOST=saab.dev-cloud.hopsworks.ai
- HOPSWORKS_PROJECT=groupX
- HOPSWORKS_API_KEY=
python run-job create [drop]
python run-job train [drop]Exploratory data analysis of the images/bounding-boxes in feature groups.
3-eda-fgs.ipynbBuild vector index for similarity search in a feature group (requires a GPU). Takes a few mins.
4-similarity-search-index.ipynbUI with gradio to do similarity search:
5-similarity-search-gradio.ipynbpip install -r requirements.txt- Download WIDERFace dataset and annotations:
python download.py- Convert annotations to YOLO format:
python annotations.py