【更新】center-face检测功能调试完成

This commit is contained in:
wdp
2025-01-18 21:12:51 +08:00
parent cd9d81e0e4
commit 09bdd8007d
12 changed files with 435 additions and 22 deletions

View File

@@ -1,6 +1,27 @@
#include <iostream>
#include <opencv2/opencv.hpp>
#include "util/TimeCount.h"
#include "CenterFaceMnn.h"
int32_t main(int32_t argc, char** argv) {
std::cout << "Hello, World!" << std::endl;
CenterFaceMnn::GetInstance();
std::vector<FaceInfo> faces;
cv::Mat img = cv::imread("F:/33.jpg");
int32_t count = 0;
re_test:
count++;
{
USE_TIME t(USE_TIME_US, "face_detect: ");
CenterFaceMnn::GetInstance()->Detect(img, faces, 1);
}
if (count < 10) {
goto re_test;
}
for(auto& face : faces) {
cv::rectangle(img, cv::Rect(face.x1, face.y1, face.x2 - face.x1, face.y2 - face.y1), cv::Scalar(0, 0, 255), 2);
}
cv::imshow("test", img);
cv::waitKey(0);
return 0;
}