Face Detection Model (YOLO-Style, Trained on WIDER FACE)
This repository provides a YOLO-style face detection model trained on the WIDER FACE dataset.
The model predicts bounding boxes across a fixed spatial grid, using S = 20 and B = 3 bounding boxes per grid cell.
Model Details
| Feature | Value |
|---|---|
| Input Resolution | 320 Γ 320 |
| Grid Size (S) | 20 Γ 20 |
| Boxes per Cell (B) | 3 |
| Output Format | (cx, cy, w, h, confidence) |
| Framework | PyTorch |
(cx, cy)are normalized center coordinates(w, h)are normalized width and heightconfidenceis the face likelihood score
Installation
git clone https://huggingface.co/sharmithas151005/face-detection-widerface-yolo-style
cd face-detection-widerface-yolo-style
pip install -r requirements.txt
Dataset: WIDER FACE
Download and prepare:
WIDER/ ββ WIDER_train/images/ ββ WIDER_val/images/ ββ wider_face_split/wider_face_train_bbx_gt.txt
Update dataset paths inside dataset.py.
Training
python train.py
--images_dir "path/to/WIDER_train/images"
--annotation_file "path/to/wider_face_train_bbx_gt.txt"
--epochs 50
--batch_size 16
--lr 0.0001
This will save trained weights as model.pth.
Inference (Run Face Detection)
python inference.py --image path/to/image.jpg --weights model.pth
This will display the image with detected faces.