Skip to content

@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 ​

ParameterType
thresholdsPartial<FaceGestureThresholds>

Returns ​

FaceGestureDetector

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
thresholdspublicFaceGestureThresholdsundefined-face/gestures.ts:220
valuesreadonlyFaceGestureValuesundefined-face/gestures.ts:221
neutralreadonlyRecord<Signal, number>undefined-face/gestures.ts:222
headpublicHeadAngles | nullnullThe 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 ​

FaceGestureState


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 ​

ParameterType
__namedParametersFaceGestureSample

Returns ​

FaceGestureName[]


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.

Returns ​

FaceGestureName[]