Base class for detecting five key points, and the score from a face image (cv::Mat).
Input a face image (cv::Mat).
Output score, five key points of the face.
Sample code:
Note: Usually the input image contains only one face. When it contains multiple faces, the function returns the highest score.
cv:Mat image = cv::imread("sample_facelandmark.jpg");
auto landmark = vitis::ai::FaceLandmark::create
("face_landmark");
auto result = landmark->run(image);
float score = result.score;
auto points = result.points;
for(int i = 0; i< 5 ; ++i){
auto x = points[i].frist * image.cols;
auto y = points[i].second * image.rows;
}
Display of the model results:
Figure 1. result image
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::FaceLandmark
class:
Type | Member | Arguments |
---|---|---|
std::unique_ptr<
FaceLandmark
> |
create |
|
std::unique_ptr<
FaceLandmark
> |
create |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|
FaceLandmarkResult
|
run |
|
std::vector<
FaceLandmarkResult
> |
run |
|