We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
Face attributes are biological features that represent facial characteristics with strong inherent stability and individual variation, which are therefore useful for identifying individuals. Important variables include gender, skin tone, age, and expression. This API recognizes attributes of human faces in images input.
Scenarios
Feature identification, service recommendations
This API identifies multiple facial attributes, and can be applied in functions such as personalized beautification and precise product recommendation.
Personalized beautification
Allows for personalized beautification by gender. For example, male user faces are beautified to reflect strength and power, while female user faces are beautified for optimal delicacy.
Precise product recommendations
Recommends products to target users, based on demographic characteristics and usage preferences.
Description
Request
Copy
FaceAttributesDetector faceAttributes = new FaceAttributesDetector(mContext); Frame frame = new Frame(); frame.setBitmap(mBitmap); JSONObject jsonObject = faceAttributes.detectFaceAttributes(frame, null); FaceAttributesInfo result = faceAttributes.convertResult(jsonObject);
1Can I call the faceCompare() method without calling the prepare() method of the API?
Yes, you can. The engine is started by default in the faceCompare() method. If the engine has already been started, it will not restart.
2When should I call the release() method?
The release() method will uninstall a model that has been loaded to the NPU chip. If the app is no longer using face detection, uninstall the model in a timely manner to free up resources.