vitis::ai::FaceQuality5pt - 2.0 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2022-01-20
Version
2.0 English
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
Image sample_facedetect_result.jpg

Quick Function Reference

The following table lists all the functions defined in the vitis::ai::FaceQuality5pt class:

Table 1. Quick Function Reference
Type Name Arguments
std::unique_ptr< FaceQuality5pt > create
  • const std::string & model_name
  • bool need_preprocess
int getInputWidth
  • void
int getInputHeight
  • void
size_t get_input_batch
  • void
Mode getMode
  • void
void setMode
  • Mode mode
FaceQuality5ptResult run
  • const cv::Mat & img
std::vector< FaceQuality5ptResult > run
  • const std::vector< cv::Mat > & images