- Capability Introduction
Age, gender attributes, expressions, and wear
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.
Feature identification, service recommendations
This API identifies multiple facial attributes, and can be applied in functions such as personalized beautification and precise product recommendation.
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.
FaceAttributesDetector faceAttributes = new FaceAttributesDetector(mContext);
Frame frame = new Frame();
JSONObject jsonObject = faceAttributes.detectFaceAttributes(frame, null);
FaceAttributesInfo result = faceAttributes.convertResult(jsonObject);
Start development here with Huawei
Service overview, application scenarios, and functions
Preparation for access, such as registration, authentication, and agreement signing
Demonstration of sample code
Interface parameter definition, description, restrictions, and constraints
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.