@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / index / FaceGestureDetector
Class: FaceGestureDetector ​
Defined in: face/gestures.ts:219
Turns frames of tracking into state and events. One per face.
ts
const detector = new FaceGestureDetector();
const events = detector.step({ timeMs, blendshapes, head });Constructors ​
Constructor ​
ts
new FaceGestureDetector(thresholds?): FaceGestureDetector;Defined in: face/gestures.ts:252
Parameters ​
| Parameter | Type |
|---|---|
thresholds | Partial<FaceGestureThresholds> |
Returns ​
FaceGestureDetector
Properties ​
| Property | Modifier | Type | Default value | Description | Defined in |
|---|---|---|---|---|---|
thresholds | public | FaceGestureThresholds | undefined | - | face/gestures.ts:220 |
values | readonly | FaceGestureValues | undefined | - | face/gestures.ts:221 |
neutral | readonly | Record<Signal, number> | undefined | - | face/gestures.ts:222 |
head | public | HeadAngles | null | null | The head's angles on the latest frame. | face/gestures.ts:224 |
Accessors ​
state ​
Get Signature ​
ts
get state(): FaceGestureState;Defined in: face/gestures.ts:256
Returns ​
neutralMeasured ​
Get Signature ​
ts
get neutralMeasured(): boolean;Defined in: face/gestures.ts:270
Whether this person's resting face has been measured yet.
Returns ​
boolean
Methods ​
resetNeutral() ​
ts
resetNeutral(): void;Defined in: face/gestures.ts:275
Measures the resting face again from the next frame.
Returns ​
void
step() ​
ts
step(__namedParameters): FaceGestureName[];Defined in: face/gestures.ts:464
One frame of tracking. Returns what happened on it, in order.
Parameters ​
| Parameter | Type |
|---|---|
__namedParameters | FaceGestureSample |
Returns ​
lost() ​
ts
lost(): FaceGestureName[];Defined in: face/gestures.ts:503
The face has gone. Everything that was on ends, so a pair of events always closes, and the resting face is kept: it's most likely the same person back.

