Face detection and recognition for Lumen
On-device face grouping for Lumen, a local-first Android gallery: it finds the faces in photos and groups them by person. Lumen downloads these files on request from its Settings; no photo or face ever leaves the phone.
Both are unchanged copies from OpenCV Zoo, commit
48b10fa505aeb51fbd127fc60a5c660040e823b7:
| File | What | Source | License |
|---|---|---|---|
yunet.onnx |
Face detection: boxes, 5 landmarks (eyes, nose tip, mouth corners), scores. Any input size | face_detection_yunet_2026may.onnx (YuNet, Shiqi Yu) |
MIT (LICENSE-YuNet) |
sface.onnx |
Face recognition: an aligned 112ร112 face โ 128-d embedding | face_recognition_sface_2021dec.onnx (SFace, Zhong et al. 2021) |
Apache 2.0 (LICENSE) |
SHA256SUMS lists each file's checksum; Lumen verifies them after download.
Using them
- YuNet: BGR, raw 0โ255 values, NCHW, height and width padded to multiples of 32. Outputs
per stride (8, 16, 32):
cls,obj,bbox,kps; score = โ(cls ร obj); box centre(col + dx, row + dy) ร stride, sizeexp(dw, dh) ร stride; landmarks(col + kx, row + ky) ร stride. - Alignment: a similarity transform (rotation, uniform scale, shift) fitted by least squares from the 5 landmarks to the standard 112ร112 template (38.29, 51.70), (73.53, 51.50), (56.03, 71.74), (41.55, 92.37), (70.73, 92.20).
- SFace: the aligned face, RGB, raw 0โ255 values, NCHW โ 128 values; L2-normalize, compare by cosine similarity. Lumen groups faces at โฅ 0.55.
Training data
OpenCV doesn't state what SFace was trained on (opencv_zoo#313); the SFace paper used research face datasets (CASIA-WebFace, VGGFace2, MS1M). The license above is OpenCV's grant for these files. YuNet was trained on WIDER FACE.
License
YuNet: MIT. SFace: Apache License 2.0. See LICENSE-YuNet, LICENSE and NOTICE.
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support