sentis-blazeface-full

Google MediaPipe BlazeFace full-range face detector converted to Unity Inference Engine (Sentis) FP32. Made for rear-camera / multi-person scenes with faces up to ~5 m away; detects faces with a bounding box, a confidence score and 6 keypoints.

Files

blazeface_full_fp32.sentis   # image [1, 192, 192, 3] RGB 0-1 (NHWC) -> faces [1, 2304, 17]
BlazeFaceFull.cs   # self-contained Unity Sentis inference

Inference

BlazeFaceFull letterboxes any Texture (Texture2D, WebCamTexture, RenderTexture) into the 192x192 model input on the GPU (aspect ratio kept, image top-left aligned), runs the model and decodes the packed output in C# with score thresholding and NMS. Preprocessing is baked into the model, so no manual normalization is needed. Results are in source-texture pixels with the origin at the top-left (y down).

A complete self-contained implementation lives in BlazeFaceFull.cs. Minimal usage:

var detector = new BlazeFaceFull(BackendType.GPUCompute);
detector.Load(modelRoot);            // folder holding blazeface_full_fp32.sentis
detector.Warmup();

foreach (var face in detector.Detect(texture))
{
    // face.Box (Rect, pixels, top-left origin), face.Score, face.Landmarks (6 points)
}

Tune ScoreThreshold (default 0.5) and NmsThreshold (default 0.3) for your scene. For per-frame use (e.g. a WebCamTexture) prefer DetectAsync, which reads the result back without stalling the main thread.

Conversion notes

  • Source: face_detection_full_range.tflite from google-ai-edge/mediapipe (MediaPipe model assets), imported directly by the Sentis LiteRT importer.
  • Preprocessing (x x 2 - 1) is prepended to the graph, and the regressor / classifier outputs are packed into one [1, 2304, 17] tensor.
  • Decoding uses the MediaPipe full-range anchors (48x48 grid, stride 4, one fixed-size anchor per cell) and a sigmoid on the score logit. Overlapping boxes are reduced with plain NMS (MediaPipe uses weighted blending).
  • Unity Sentis output matches the source model run in LiteRT on the same input.

License & attribution

Apache-2.0. Converted from the BlazeFace full-range model of google-ai-edge/mediapipe (Apache-2.0). Paper: BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs.

Downloads last month
1
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Paper for Sky-Kim/com.sky.sentis.blazeface-full