-
Notifications
You must be signed in to change notification settings - Fork 1
/
FaceDetector.h
executable file
·59 lines (45 loc) · 929 Bytes
/
FaceDetector.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
53
54
55
56
57
58
59
//
// Created by dl on 19-7-19.
//
#ifndef FACE_DETECTOR_H
#define FACE_DETECTOR_H
#include <opencv2/opencv.hpp>
#include <string>
#include <stack>
#include <chrono>
using namespace std::chrono;
struct Point{
float _x;
float _y;
};
struct bbox{
float x1;
float y1;
float x2;
float y2;
float s;
Point point[5];
};
struct box{
float cx;
float cy;
float sx;
float sy;
};
class Detector
{
public:
Detector();
~Detector();
inline void Release();
void nms(std::vector<bbox> &input_boxes, float NMS_THRESH);
void Detect(std::vector<bbox>& boxes, std::vector<std::vector<float>> results);
void create_anchor(std::vector<box> &anchor, int w, int h);
void create_anchor_retinaface(std::vector<box> &anchor, int w, int h);
static inline bool cmp(bbox a, bbox b);
public:
float _nms;
float _threshold;
float _mean_val[3];
};
#endif //