Skip to main content
Version: 3.19.2

Face Fitter

In this section you will learn how to integrate Face Fitter to your C++ or Python project.

Face Fitter (C++/Python)

1. Create a Face Fitter

1.1 To create Face Fitter, follow steps 1-3 described in Creating a Processing Block] and specify the values:

  • "FACE_FITTER" for the "unit_type" key;
configCtx["unit_type"] = "FACE_FITTER";

1.2. Create a Face Fitter block:

pbio::ProcessingBlock faceFitter = service->createProcessingBlock(configCtx);

2. Detection of Face Landmarks

2.1 Perform face detection using FaceDetector as described in Face, Body and Object Detection] section.

2.2 Pass the resulting Context container to the faceFitter call:

faceFitter(ioData);

The result of the faceFitter() call is to add the result of processing samples (images) to the 'ioData' container.

Key points of the face are added to each object from the list of objects available by the key "objects".

The key "keypoints" contains a set of named key points, each of which contains the values "proj", and also a list of all points in the key "points", each of which contains the values "x" and "y".

The points are the relative coordinates of a point in the range [0,1].

/*
[{
"keypoints": [
{"proj": {x_proj, y_proj}, "confidence": {"type": "double", "minimum": 0, "maximum": 1}}, ...
"points": [{"x", "y"}: {"type": "double", "minimum": 0, "maximum": 1}]
]
}]
*/