-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathseeta_recognizer.hpp
46 lines (41 loc) · 1.44 KB
/
seeta_recognizer.hpp
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
#ifndef _SEETA_RECOGNIZER_H_
#define _SEETA_RECOGNIZER_H_
#include <seeta/FaceDetector.h>
#include <seeta/FaceLandmarker.h>
#include <seeta/FaceRecognizer.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <chrono>
#include <string>
#include <dirent.h>
#include <map>
#include <iostream>
using namespace seeta;
using namespace cv;
using namespace std;
using namespace filesystem;
class Recognizer {
public:
Recognizer(const string&, vector<string>);
vector<pair<string, float>> recognize(Mat);
private:
FaceDetector *fd;
FaceRecognizer *fr;
FaceLandmarker *fl;
map<string, shared_ptr<float>> knownFeatures;
void loadModels(vector<string>);
void loadKnownFeatures(const FaceDetector *,
const FaceLandmarker *,
const FaceRecognizer *,
const string&,
map<string, shared_ptr<float>> *);
static void convertImage(const Mat& cvImage, SeetaImageData *seetaImage);
static void extract_feature(const FaceDetector *,
const FaceLandmarker *,
const FaceRecognizer *,
const Mat& image,
float *feature);
static bool cmp(const pair<string, float>&, const pair<string, float>&);
};
#endif