Skip to content

Face Detection

On this page, find detailed information about face detection in Face SDK Web API.

Request

The SDK uses several parameters to detect faces, they all are collected in the detections field of Response.

You can define whether to detect all the faces on an image or just one (the most central one) with the onlyCentralFace parameter in Request.

The request contains the following parameters:

Parameter Description
image Base64 image
thumbnails

If set to true, returns thumbnail—Base64 cropped image that contains a vertically aligned face.

If set to false, thumbnail is not returned.

Default: false.

onlyCentralFace

If set to true, the SDK detects only one—the most central face on the image.

If set to false, the SDK detects all faces on the image.

Default: true. If it is not mentioned, processed as true.

attributes

If set to true, returns a flag for calculating the faces attributes and the quality characteristics: occlusions, emotions, age, blur amount, noise, brightness, symmetry indicator.

Default: false. If it is not mentioned, processed as false.

Response

The response contains the following parameters:

└── code
└── msg
└── results
|   └── detections
|   |   └── landmarks
|   |   └── roi
|   |   └── rotationAngle
|   |   └── thumbnail
└── detectorType
└── landmarksType
Parameter Description
code The code the SDK returns.
msg

The message result.

If everything is OK, the result looks as follows:

code: 0,

msg: FACER_OK,

See the list of error codes below.

results Includes detections, detectorType, landmarksType.
detections The array of detected faces. Includes landmarks, roi, rotationAngle, thumbnail for each of the detected faces.
landmarks Returns absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips.
roi Сoordinates of the rectangular area that contains the face relative to the overall image: x, y, height, width.
rotationAngle Angle of rotation of the face from the vertical axis, degrees.
thumbnail Base64 cropped image that contains the vertically aligned face.
detectorType The type of detector. It is for internal use and can not be changed.
landmarksType The type of landmarks identification. It is for internal use and can not be changed.

Errors

Here is a list of possible errors and their meanings:

Error Description
FR_FACE_NOT_DETECTED = 2 No faces are detected, most probably, the image does not contain faces.
FACER_NO_LICENSE = 200 There is no license.
FACER_IS_NOT_INITIALIZED = 201 The library is not initialized.
FACER_COMMAND_IS_NOT_SUPPORTED = 202 The command is not supported.
FACER_COMMAND_PARAMS_READ_ERROR = 203 The request is formed incorrectly.
Back to top