FaceAttributeInterface
APJS Script API reference for the FaceAttributeInterface interface.
| Type | Name | Interface Description |
|---|---|---|
| Variables | age: number | • Function: Predicted age value in the range [0, 100]. |
| Variables | attractive: number | • Function: Attractiveness score in the range [0, 100]. |
| Variables | boyProbability: number | • Function: Probability of being male in the range [0.0, 1.0]. |
| Variables | expressionProbabilities: Float32Array | • Function: The probabilities of facial expression types |
| Variables | expressionType: FaceAttrExpression | • Function: The classified facial expression for this face. |
| Variables | gender: FaceAttrGender | • Function: gender |
| Variables | happyScore: 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) {
}
}