face-rfdetr-nano

RF-DETR Nano fine-tuned on WIDERFACE for single-class face detection. Exported to ONNX (opset 17, 384x384 input) so the same weights run in Python (via onnxruntime) and in the browser (via libreyolo-web).

Part of the LibreYOLO family. MIT licensed. No AGPL.

Use it

pip install onnxruntime opencv-python huggingface_hub numpy
python -m src.use_pretrained --image my_photo.jpg

Full use case (pipeline, notebook, browser demo): LibreYOLO/use-cases/blur-faces.

Numbers

Trained on a tiny slice of WIDERFACE: 80 train images, 20 val images, 30 epochs, RF-DETR Nano backbone, 384 input, Apple MPS.

Metric Value
AP @ IoU 0.50 0.93
AR small 0.52
AR medium 0.61
AR large 0.80
Training time 38 min

Both numbers are noisy because the val split is only 20 images. The model blurs well-lit frontal faces reliably and misses tiny or occluded ones. For production use, fine-tune on more data with the same pipeline.

Reproduce

git clone https://github.com/LibreYOLO/use-cases
cd use-cases/blur-faces
pip install -r requirements.txt
python -m src.download_widerface
python -m src.train --epochs 30
python -m src.eval

I/O

  • Input: float32 tensor [1, 3, 384, 384], RGB, ImageNet-normalized (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]), direct resize (no letterbox).
  • Outputs: two tensors, boxes [B, Q, 4] (cxcywh, normalized to [0,1]) and logits [B, Q, 2] (background + face, apply sigmoid).
  • Q is 300 query slots. Filter by sigmoid score threshold.

License

MIT for the weights. Training data is WIDERFACE and inherits its own license terms.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train LibreYOLO/face-rfdetr-nano

Collection including LibreYOLO/face-rfdetr-nano