facemesh

This repository hosts the facemesh models exported for the React Native ExecuTorch library as ExecuTorch .pte programs, ready to run on device.

Upstream model: MediaPipe Face Mesh, ported to PyTorch

A face mesh model regresses 468 3-D landmarks over a single face and scores how confident it is that it was shown a face at all. It does not search an image for faces: give it a crop that a face detector such as blazeface already found.

Variants

Path Backend Precision
xnnpack/facemesh_xnnpack_fp32.pte xnnpack fp32
coreml/facemesh_coreml_fp16.pte coreml fp16

Interface

forward: [1, 3, 192, 192] f32
      -> (boxes [1, 4] f32, scores [1] f32, keypoints [1, 468, 4] f32)

The input is RGB, channels-first, normalized to v / 127.5 - 1. The outputs follow the same shape every keypoint model in this collection publishes, with one candidate: boxes is the xyxy hull of the mesh in input-pixel units, scores is the face-presence probability, and each landmark is x, y, confidence, z. The mesh carries no per-landmark confidence, so that column is a constant 1; z is a relative depth on the same scale as x, negative towards the camera.

Landmark order is MediaPipe's canonical face model, so any lip, eye or face-oval index list published for MediaPipe Face Mesh applies unchanged.

Repository structure

config.json                        30 B
coreml/config.json                 719 B
coreml/facemesh_coreml_fp16.pte    1.6 MB
xnnpack/config.json                721 B
xnnpack/facemesh_xnnpack_fp32.pte  2.5 MB

Compatibility

These files are published for the ExecuTorch v1.4.1 runtime. ExecuTorch gives no forward compatibility guarantee, so an older runtime may fail to load them.

To use them in React Native ExecuTorch, pass the model constant shipped in the library's model registry to the corresponding task pipeline. See the documentation.

To load these files in your own ExecuTorch runtime, read the compatibility note first.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support