CUHK-CSE/wider_face
Updated β’ 2.31k β’ 51
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.
| 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 height confidence is the face likelihood scoregit clone https://huggingface.co/sharmithas151005/face-detection-widerface-yolo-style
cd face-detection-widerface-yolo-style
pip install -r requirements.txt
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.
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.
python inference.py --image path/to/image.jpg --weights model.pth
This will display the image with detected faces.