forked from liushuan/MNN-MTCNN-CPU-OPENCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathface_detect.h
53 lines (35 loc) · 897 Bytes
/
face_detect.h
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
50
51
52
#ifndef _FACE_DETECT_H_
#define _FACE_DETECT_H_
#include <opencv2/opencv.hpp>
#include <memory>
#include <vector>
#ifdef _OPENMP
#include <omp.h>
#endif
using std::string;
using std::vector;
namespace TIEVD{
typedef struct FaceBox {
float xmin;
float ymin;
float xmax;
float ymax;
float score;
} FaceBox;
typedef struct FaceInfo {
float bbox_reg[4];
float landmark_reg[10];
float landmark[10];
FaceBox bbox;
} FaceInfo;
class FaceDetect {
public:
FaceDetect(const string& proto_model_dir, float threhold_p=0.7f, float threhold_r=0.8f, float threhold_o = 0.8f, float factor = 0.709f);
std::vector<FaceInfo> Detect(const cv::Mat& img, const int min_face = 64 , const int stage = 3);
std::vector<FaceInfo> Detect_MaxFace(const cv::Mat& img, const int min_face= 64, const int stage = 3);
~FaceDetect();
private:
int threads_num = 2;
};
}
#endif // _FaceDetect_H_