main.cpp
2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "facecomparison.h"
int main(){
// FaceLandmarks face_landmarks1 = FaceLandmarks("/home/situ/qfs/sdk_project/mnn_projects/face_recognize_mnn/model/det_landmarks_106_v0.0.1.mnn");
// vector<string> filenames;
// cv::glob("/home/situ/图片/img3", filenames, false);
// for(auto path:filenames){
// // cout<<path<<endl;
// Mat img1 =cv::imread(path);
// auto landmarks1 = face_landmarks1.inference(img1);
// for(auto landm:landmarks1){
// cv::circle(img1,Point2d(landm[0],landm[1]),2,Scalar(255,0,0));
// }
// cv::imshow("img",img1);
// cv::waitKey(0);
// }
Mat image1 = cv::imread("/data/face_recognize/pipeline_test/35326a760af111ec9f2300163e772630/310cardImageContent163047910320427.jpg");
Mat image2 = cv::imread("/data/face_recognize/pipeline_test/35326a760af111ec9f2300163e772630/310faceImageContent163047910353714.jpg");
string face_det_model = "/home/situ/qfs/sdk_project/mnn_projects/face_recognize_mnn/model/det_face_retina_mnn_1.0.0_v0.1.1.mnn";
string face_landm_model = "/home/situ/qfs/sdk_project/mnn_projects/face_recognize_mnn/model/det_landmarks_106_v0.0.1.mnn";
string face_rec_model = "/home/situ/qfs/sdk_project/mnn_projects/face_recognize_mnn/model/cls_face_mnn_1.0.0_v0.1.1.mnn";
FaceComparison face_rec = FaceComparison(face_det_model,face_landm_model,face_rec_model);
bool result = face_rec.inference(image1,image2);
cout<<result<<endl;
// string model_path = "/home/situ/qfs/sdk_project/mnn_projects/face_recognize_mnn/model/det_face_retina_mnn_1.0.0_v0.1.1.mnn";
// RetinaFace face_det = RetinaFace(model_path.c_str());
// Mat image = cv::imread("/home/situ/图片/2.png");
// vector<Bbox> result = face_det.inference("/home/situ/图片/2.png");
// for(auto res:result){
// cv::rectangle(image,cv::Rect(res.xmin,res.ymin,res.xmax-res.xmin,res.ymax-res.ymin),Scalar(0,255,0),2);
// }
// cv::imshow("image",image);
// cv::waitKey(0);
// return 0;
}