forked from Kagami/go-face
-
Notifications
You must be signed in to change notification settings - Fork 0
/
facerec.h
40 lines (35 loc) · 918 Bytes
/
facerec.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
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
IMAGE_LOAD_ERROR,
SERIALIZATION_ERROR,
UNKNOWN_ERROR,
} err_code;
typedef struct facerec {
void* cls;
const char* err_str;
err_code err_code;
int jittering;
unsigned long size;
double padding;
} facerec;
typedef struct faceret {
int num_faces;
long* rectangles;
float* descriptors;
int num_shapes;
long* shapes;
const char* err_str;
err_code err_code;
} faceret;
facerec* facerec_init(const char* model_dir);
faceret* facerec_recognize(facerec* rec, const uint8_t* img_data, int len, int max_faces,int type);
void facerec_set_samples(facerec* rec, const float* descriptors, const int32_t* cats, int len);
int facerec_classify(facerec* rec, const float* descriptor, float tolerance);
void facerec_free(facerec* rec);
void facerec_config(facerec* rec, unsigned long size, double padding, int jittering);
#ifdef __cplusplus
}
#endif