Scripting API
FaceTrackingModule
FaceTrackingModule Overview

FaceTrackingModule

Enables the tracking of faces in three-dimensional space and exposes classes that describe key points of a detected face.
Importing this module automatically enables thecapability within the project's *Properties*.

For two-dimensional face tracking, see the FaceTracking2D module.

Example

Properties

PropertyDescription

count

(get) count: ScalarSignal
(set) (Not Available)


The number of faces currently tracked in the scene, as a ScalarSignal.

Methods

MethodDescription

createFaceMeshSceneObject

createFaceMeshSceneObject(initialState?: {[key: string]: any}): Promise<FaceMesh>


Creates a new dynamicFaceMesh object in the scene.

  • initialState - an optional set of JSON-formatted parameters to instantiate the FaceMesh object with. For example, {"name": "DynamicFaceMesh", "visible": true}. The parameter keys must be valid FaceMesh object properties.

Note: This API requires "Scripting Dynamic Instantiation" capability to be enabled.

createFaceTrackerSceneObject

createFaceTrackerSceneObject(initialState?: {[key: string]: any}): Promise<FaceTracker>


Creates a new dynamicFaceTracker object in the scene.

  • initialState - an optional set of JSON-formatted parameters to instantiate the FaceTracker object with. For example, {"name": "DynamicFaceTracker", "visible": true}. The parameter keys must be valid FaceTracker object properties.

Note: This API requires "Scripting Dynamic Instantiation" capability to be enabled.

face

face(index: number): Face


Returns a Face object from the array of detected faces.

  • index - the index of the Face object to retrieve from the array.


Classes

ClassDescription
CheekExposes key points of the cheek of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.

ChinExposes key points of the chin of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.

EyeExposes details and key points of the eye of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.

EyebrowExposes key points of the eyebrow of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.

FaceExposes details and key points of a three-dimensionally tracked face.

ForeheadExposes key points of the forehead of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.

MouthExposes details and key points of the mouth of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.

NoseExposes key points of the nose of a detected Face object.
Key points are returned in the detected face's local coordinate system. Use Face.cameraTransform.applyToPoint() to convert the point to the camera's coordinate system.