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.
The face sample
Section titled “The face sample”| 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).
Threshold sets
Section titled “Threshold sets”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.
Writing a provider
Section titled “Writing a provider”- Web or React Native: build
FaceSampleobjects and callengine.push(sample)on aMimicEnginefrom@vidrip/mimic-core, once per frame, in time order. - Unity: derive from
MimicFaceSource, overrideCaps, and callPublish(sample)once per frame.Publishis safe from any thread. OverrideIsReady,StatusandPreviewTextureso UIs can show what your source is doing.