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.
Facial feature detection detects the key features of a human face in an input image, and returns the coordinates of key points that represent the facial contours.
This API is used to detect the key features on human faces in input images, and return the coordinates of the key points (276 landmark points) that represent the facial contours, providing input for processing for subsequent algorithms for beautification, facial modeling, and facial expression identification.
Scenarios
Beautification, facial expression recognition
This API provides the precise coordinates for key contour points for all five sense organs on a human face, and can be applied in diverse functions, including facial beautification, facial modeling, and facial expression recognition.
Facial beautification
This function implements targeted beautification, based on the location of facial features.
Facial modeling
This function assists in the conversion from a portrait to a 3D character model for photos, based on the positions of key facial features.
Description
Request
Copy
FaceLandMarkDetector lm = new FaceLandMarkDetector(mContext); Frame frame = new Frame(); frame.setBitmap(mBitmap); JSONObject jsonObject = lm.detectLandMark(frame, null); List<FaceLandmark> landMarks = lm.convertResult(jsonObject);
Response
Copy
{
"resultCode": 0,
"landmark": "[{\"positionF\":
{\"x\":333.34082,\"y\":389.04736},\"type\":-1},
{\"positionF\":
Start development here with Huawei
Service introduction
Service overview, application scenarios, and functions
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.