LibreFaceRec
LibreFaceRec is LibreYOLO's face-embedding task: a face detector locates and aligns faces, and a recognition head produces an L2-normalized identity embedding for verification or search.
- Tasks
- embed
- Sizes
- Install
pip install libreyolo- Support tier
- Inference only, since v. Predict, validate and export only. Training features do not apply.
- Licenses
- Code MIT, weights Apache-2.0. Commercial use
Install
LibreFaceRec's recognition head runs through onnxruntime, which is not part
of the base install.
pip install "libreyolo[onnx]"Predict
from libreyolo import LibreYOLO, SAMPLE_IMAGE # librefacerec-* names route to this family regardless of file# suffix and download from the LibreYOLO Hugging Face org on first# use, along with the default face detector.model = LibreYOLO("librefacerec-l.onnx")result = model(SAMPLE_IMAGE) print(result.embeddings.data.shape) # (N, D), L2-normalizedlibreyolo predict model=librefacerec-l.onnx source=face.jpgfrom libreyolo import LibreYOLO model = LibreYOLO("librefacerec-l.onnx") # Compares the most prominent face in each image via cosine# similarity of their L2-normalized embeddings.result = model.verify("person_a.jpg", "person_b.jpg", threshold=0.4)print(result["similarity"], result["same_person"])from libreyolo import LibreYOLO model = LibreYOLO("librefacerec-l.onnx") query = model("query.jpg").embeddings # this image's facesgallery = model.embed(["a.jpg", "b.jpg", "c.jpg"]) # (N_total, D) # (query_faces, N_total) cosine similarities.scores = query.similarity(gallery)Detection and recognition are two separate ONNX graphs behind one call: a
face detector locates and aligns each face to a canonical crop, and the
recognition head returns an L2-normalized embedding per face. Left alone,
predict() downloads and pairs the bundled default detector automatically.
face_detector accepts a callable, a LibreYOLO detection model, or a
FaceDetector instance; face_boxes bypasses detection entirely with boxes
you already have. result.embeddings holds one row per detected face,
aligned with result.boxes; its .similarity() method computes cosine
similarity against another embedding or a whole gallery in one call. For
comparing two images directly rather than two already-computed embeddings,
model.verify(image_a, image_b) runs detection and embedding on both and
compares their most confident face. Any other ArcFace-convention ONNX
recognition model (aligned crop in, (N, D) embeddings out) can be
substituted by passing its file path instead of a librefacerec-* name. See
prediction for sources, streaming and result handling.
Export
| Task | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| embed | embed to ONNX: not supported | embed to TorchScript: not supported | embed to ExecuTorch: not supported | embed to TensorRT: not supported | embed to OpenVINO: not supported | embed to Paddle: not supported | embed to MNN: not supported | embed to RKNN: not supported | embed to ncnn: not supported | embed to TFLite: not supported | embed to CoreML: not supported | embed to Core AI: not supported |
LibreFaceRec already wraps a pre-exported ONNX graph; re-exporting it to another format is not implemented.
Licensing
Check the license on the Hugging Face repository of the specific weights you download. Every checkpoint in the LibreYOLO org carries one, and they are not always the same across a family. That repository is the authoritative source; the summary below describes what applied when this page was last verified.
This is a description of the licenses involved, not legal advice. If the answer matters commercially, read the licenses yourself and take your own counsel.
- Original work
- AuraFace-v1, fal.ai
- Upstream license
- Apache-2.0
- Upstream source
- huggingface.co/fal/AuraFace-v1
- LibreYOLO code
- MIT
- Weights
- Apache-2.0, distributed by their authors. LibreYOLO does not host or mirror them.
- Interpretation
- Apache-2.0 covers the embedding weights (AuraFace-v1's glintr100 recognition head), so they may be used, modified and redistributed, including commercially, provided the license text and attribution notices travel with any copy. LibreYOLO's default face detector is a separate artifact under a separate license, MIT (OpenCV Zoo's YuNet, copyright Shiqi Yu). No code is ported from either project: both graphs are consumed opaquely through onnxruntime, so LibreYOLO's own wrapper code, which carries no third-party architecture, is MIT throughout. Any other ArcFace-convention ONNX recognition model can be substituted by passing its file path, and that file's own license then applies instead of AuraFace-v1's.
The bundled default face detector is a second artifact under a second
license: OpenCV Zoo's YuNet, MIT, copyright Shiqi Yu. No architecture code is
ported from either project; both graphs are consumed opaquely through
onnxruntime, so LibreYOLO's own wrapper carries no third-party code and is
MIT throughout.
Citation
@inproceedings{deng2019arcface,
title={Arcface: Additive angular margin loss for deep face recognition},
author={Deng, Jiankang and Guo, Jia and Xue, Niannan and Zafeiriou, Stefanos},
booktitle={CVPR},
year={2019}
}Copied from the authors' citation block at github.com/deepinsight/insightface/tree/master/recognition/arcface_torch#citations.