Skip to main content

FaceAttributeInterface

APJS Script API reference for the FaceAttributeInterface interface.

TypeNameInterface Description
Variablesage: number

Function: Predicted age value in the range [0, 100].

Variablesattractive: number

Function: Attractiveness score in the range [0, 100].

VariablesboyProbability: number

Function: Probability of being male in the range [0.0, 1.0].

VariablesexpressionProbabilities: Float32Array

Function: The probabilities of facial expression types

VariablesexpressionType: FaceAttrExpression

Function: The classified facial expression for this face.

Variablesgender: FaceAttrGender

Function: gender

VariableshappyScore: number

Function: Degree of happiness in the range [0, 100].

Examples

expressionType: FaceAttrExpression

const attr = result.getFaceAttributeInfo(0);
if (attr.expressionType === APJS.FaceAttrExpression.Happy) {
// react to a smile
}

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use FaceAttributeInterface here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies