Base class for evaluating the quality and five key points coordinate of a face image (cv::Mat).
Input is a face image (cv::Mat).
Output is the quality and five key points coordinate of a face in the input image.
Sample code :
Display of the FaceQuality5pt
model results:
cv:Mat image = cv::imread("sample_facequality5pt.jpg");
auto network =
vitis::ai::FaceQuality5pt::create("face-quality", true);
auto result = network->run(image);
auto quality = result.score;
auto points = result.points;
for(int i = 0; i< 5 ; ++i){
auto x = points[i].frist * image.cols;
auto y = points[j].second * image.rows;
}
Note: Default mode is day, if day night switch network is used and the background of the input image is night, please use API setMode
network->setMode(vitis::ai::FaceQuality5pt::Mode::NIGHT);
Figure 1. result image
Quick Function Reference
The following table lists all the functions defined in the vitis::ai::FaceQuality5pt
class:
Type | Name | Arguments |
---|---|---|
std::unique_ptr< FaceQuality5pt > |
create |
|
int | getInputWidth |
|
int | getInputHeight |
|
size_t | get_input_batch |
|
Mode
|
getMode |
|
void | setMode |
|
FaceQuality5ptResult
|
run |
|
std::vector< FaceQuality5ptResult > |
run |
|