facecomparison.h
1.07 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
41
42
43
44
45
46
47
48
49
#ifndef FACECOMPARISON_H
#define FACECOMPARISON_H
#include "facerecognize.h"
#include "retinaface.h"
#include "facelandmarks.h"
struct OutputInfo{
int error_code;
bool result;
};
struct InitModelError{
vector<bool> init_error;
};
class FaceComparison{
public:
// 人脸检测阈值
float confidence_threshold = 0.5;
// 是否进行人脸外廓
bool is_bbox_process = true;
// 人脸比对相似度阈值
float face_recongnize_thr = 0.5;
// 线程个数
int num_thread = 2;
// 推理方式
MNNForwardType forward_type = MNN_FORWARD_CPU;
//接口
int inference(string image_path1,string image_path2,OutputInfo &output_info);
int inference(Mat image1,Mat image2,OutputInfo &output_info);
private:
RetinaFace face_det;
FaceLandmarks face_landm;
FaceRecognize face_rec;
public:
FaceComparison(){};
bool init_model(string face_det_model,string face_landm_model,string face_rec_model,InitModelError &model_error);
};
#endif