Skip to content

Providers and threshold sets

A provider turns camera frames into face samples. Mimic ships one per platform, and you can write your own: for a recorded session, a different tracker, or a test.

Field Meaning
t Milliseconds, strictly increasing
faceFound Whether this frame has a face. Send frames without one too; that’s how face.lost works.
aspect Frame width / height
mirrored Whether the frame is the raw camera image of a selfie camera (the preview shows it mirrored). Mimic converts everything into the player’s left and right.
landmarks 478 × (x, y, z), normalised to the frame (0 to 1), z in x’s units
blendshapes 52 expression scores (0 to 1) in the standard ARKit/MediaPipe order
pose Head yaw, pitch and roll in degrees

Any of the last three can be missing. A provider declares what it fills (caps), and Mimic arms only the gestures it can feed (see capabilities).

The same gestures, tuned for how a camera sees a face. Pick the one that matches your provider:

Set Use it for
Phone (default) The native React Native provider and Unity on iOS and Android.
Web Browsers, and Unity’s camera provider on a desktop webcam. Same thresholds, browser left/right conventions.
Web + laptop Webcams further from the face or on slow machines (under about 20 fps). Fires blinks and smiles a little earlier. The web package picks it automatically on devices with a mouse.

You can also layer your own overrides on top of a set (on the web, spec: ['laptop', { detectors: { … } }]). Treat that as an escape hatch and tell us what you changed, so the defaults can improve.

  • Web or React Native: build FaceSample objects and call engine.push(sample) on a MimicEngine from @vidrip/mimic-core, once per frame, in time order.
  • Unity: derive from MimicFaceSource, override Caps, and call Publish(sample) once per frame. Publish is safe from any thread. Override IsReady, Status and PreviewTexture so UIs can show what your source is doing.