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, size exp(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.

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