Instructions to use Banaxi-Tech/face-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use Banaxi-Tech/face-model with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("Banaxi-Tech/face-model", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
File size: 1,059 Bytes
d176ecd | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #!/usr/bin/env python3
"""Evaluate one or more face-detector weights (.pt / .onnx) on the converted WIDER FACE val split.
Usage: python eval_model.py export/face_yolo11n.pt export/face_yolo11n_fp32.onnx export/face_yolo11n_fp16.onnx
"""
import argparse
from ultralytics import YOLO
def main():
ap = argparse.ArgumentParser()
ap.add_argument("models", nargs="+")
ap.add_argument("--data", default="dataset/data.yaml")
ap.add_argument("--imgsz", type=int, default=640)
ap.add_argument("--workers", type=int, default=4)
a = ap.parse_args()
for path in a.models:
r = YOLO(path, task="detect").val(data=a.data, imgsz=a.imgsz, batch=1, device=0,
workers=a.workers, plots=False, verbose=False)
print(f"RES {path}: mAP50={r.box.map50:.4f} mAP50-95={r.box.map:.4f} P={r.box.mp:.3f} R={r.box.mr:.3f} "
f"| {r.speed['preprocess']:.2f}+{r.speed['inference']:.2f}+{r.speed['postprocess']:.2f} ms/img",
flush=True)
if __name__ == "__main__":
main()
|