入力イメージ (cv::Mat) 内の顔の位置を検出するためのベース クラス。
入力はイメージ (cv::Mat) です。
出力は入力イメージ内の顔の位置およびスコアのベクターです。
サンプル コード:
auto image = cv::imread("sample_facedetect.jpg");
auto network = vitis::ai::FaceDetect::create
(
"densebox_640_360",
true);
auto result = network->run(image);
for (const auto &r : result.rects) {
auto score = r.score;
auto x = r.x * image.cols;
auto y = r.y * image.rows;
auto width = r.width * image.cols;
auto height = r.height * image.rows;
}
width=\textwidth の場合のモデルの結果を次に示します。
図 1. 結果イメージ

関数クイック リファレンス
次の表に、vitis::ai::FaceDetect
クラスに定義されているすべての関数を示します。
タイプ | メンバー | 引数 |
---|---|---|
std::unique_ptr<
FaceDetect
> |
create |
|
std::unique_ptr<
FaceDetect
> |
create |
|
float | getThreshold |
|
void | setThreshold |
|
FaceDetectResult
|
run |
|
std::vector<
FaceDetectResult
> |
run |
|
std::vector<
FaceDetectResult
> |
run |
|