Facial Feature Detection

Capability Introduction

Facial feature detection, contour dotting

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
Learn more

Access preparation

Preparation for access, such as registration, authentication, and agreement signing
Learn more

Sample code

Demonstration of sample code
Learn more

API description

Interface parameter definition, description, restrictions, and constraints
Learn more
FAQ
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.