Capability Introduction

Face partition, in-depth parsing

Face parsing analyzes the surface composition of the human head (including the face), to obtain insights on features. This API is mainly used to parse the human face in an input image, and provide facial area parsing results, based on 16 categories: hair, the background, facial skin, left eyebrow, right eyebrow, left eye, right eye, nose, upper lip, mouth interior, lower lip, left ear, right ear, neck, glasses, and sunglasses.
Scenarios

Facial rendering, facial expression interpretation

This API accurately parses 16 facial region categories, and can be applied in functions such as facial beautification, makeup testing, and facial expression recognition.

Facial beautification

This function implements targeted beautification, based on the location of facial features.

Facial expression recognition

Recognizes facial expressions, based on the features of the five sense organs.

Description

Request
Copy

FaceParsing faceParsing = new FaceParsing(mContext);
Frame frame = new Frame();
frame.setBitmap(mBitmap);
ImageResult result = faceParsing.doFaceParsing(frame, null);
Bitmap newbmp = result.getBitmap();

Response
Copy

{
    "resultCode":0
}

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.