Skip to main content

AlgorithmResult

TypeNameInterface Description
FunctionsgetFaceAttributeCount(): number

Get the number of recognized facial feature information items

FunctionsgetFaceAttributeInfo(index: number): FaceAttributeInterface

Get the facial feature information at the specified index

FunctionsgetFaceBaseInfo(index: number): FaceDBInterface

Get the number of recognized facial landmark point information items

FunctionsgetFaceCount(): number

Get the number of recognized faces

FunctionsgetFaceFaceMask(index: number): FaceFaceMaskInterface

Get the FaceMask information of the specified index

FunctionsgetFaceMouthMask(index: number): FaceMouthMaskInterface

Get the MouthMask information of the face at the specified index

FunctionsgetFacePetInfo(index: number): FacePetInfoInterface

Get pet information at the specified index

FunctionsgetFacePetInfoCount(): number

Get the number of recognized pet faces

FunctionsgetFaceTeethMask(index: number): FaceTeethMaskInterface

Get the TeethMask information of the face at the specified index

Examples

getFaceAttributeCount(): number

const faceCount = result.getFaceAttributeCount();

getFaceAttributeInfo(index: number): FaceAttributeInterface

const faceAttr = result.getFaceAttributeInfo(0);

getFaceBaseInfo(index: number): Face106Interface

const faceBaseInfo = result.getFaceBaseInfo(0);

getFaceCount(): number

const faceCount = result.getFaceCount();

getFaceFaceMask(index: number): FaceFaceMaskInterface

const faceMask = result.getFaceFaceMask();

getFaceMouthMask(index: number): FaceMouthMaskInterface

const faceMouthMask = result.getFaceMouthMask();

getFacePetInfo(index: number): FacePetInfoInterface

const facePetInfo = result.getFacePetInfo();

getFacePetInfoCount(): number

const facePetInfoCount = result.getFacePetInfo();

getFaceTeethMask(index: number): FaceTeethMaskInterface

const faceTeethMask = result.getFaceTeethMask();

Use Cases

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
const result = APJS.AlgorithmManager.getResult();
if (!result)
return;

const faceCount = result.getFaceAttributeCount();
if (faceCount <= 0)
return;

const faceAttr = result.getFaceAttributeInfo(0);
if (faceAttr) {
const resultStr = `age: ${faceAttr.age},
attractive: ${faceAttr.attractive},
boyProb: ${faceAttr.boyProb},
expProbs: ${faceAttr.expProbs.length},
expType: ${faceAttr.expType} ${FaceExpression[faceAttr.expType]},
gender: ${faceAttr.gender},
happyScore: ${faceAttr.happyScore},
quality: ${faceAttr.quality},`
}
}
onUpdate(deltaTime: number) {
}
}

AlgorithmShowCase.ts

Copyright © 2025 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalCookies