main.cpp 2.12 KB
#include "facecomparison.h"
int main(){
    // FaceLandmarks face_landmarks1 = FaceLandmarks("/home/situ/qfs/sdk_project/mnn_projects/face_recognize_mnn2/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.detect_landmarks(path);
    //     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.0.2.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.face_compare_image(image1,image2);
    cout<<result<<endl;


    // string model_path = "/home/situ/qfs/sdk_project/mnn_projects/face_retinaface_mnn/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.detect_image(image);
    // 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;
}