DFace SDK  2.0.0
LTM
dface_compare.h
1 
2 /*****************************************************************************
3 * DFace pro SDK library
4 * Copyright (C) 2018 杭州小孔成像科技有限公司(dface.tech).
5 * @file dface_c.h
6 * @brief DFace人脸比对API抽象类
7 *
8 *
9 * @author Pinhole(dface.tech)
10 * @email customer@dface.tech
11 * @version 1.3.2
12 * @date 2018-05-02
13 * @license no free
14 *
15 *----------------------------------------------------------------------------
16 * Remark : Description
17 *----------------------------------------------------------------------------
18 * Change History :
19 * <Date> | <Version> | <Author> | <Description>
20 *----------------------------------------------------------------------------
21 * 2018/05/02 | 1.3.2 | Pinhole |
22 *----------------------------------------------------------------------------
23 *
24 *****************************************************************************/
25 
26 #ifndef DFACE_C_H
27 #define DFACE_C_H
28 
29 #include <string>
30 #include "dface/common.h"
31 
32 namespace dface {
33 
34  using namespace std;
35 
40  class DFACE_EXPORTS DfaceCompare {
41  public:
42  DfaceCompare() {};
43  virtual ~DfaceCompare() { return; };
44 
45  /*
46  * 初始化
47  * @param model_path 模型目录
48  * @param accuracy 精度模式 0:普通精度 1:高精度 2:实时
49  */
50  virtual bool init(string &model_path, int accuracy) = 0;
51 
59  virtual float similarityByFeature(std::vector<float> &feature_1, std::vector<float> &feature_2) const = 0;
60 
61 
70  virtual float similarityByFeature(float *feature_1, float *feature_2, int feature_size = 512) const = 0;
71 
72 
84  virtual void similarityByFeatureSort(std::vector<float> &feature_1, std::vector <std::vector<float> > &feature_n, std::vector<int> &idx_n, std::vector<float> &out_simi, std::vector<int> &out_idx,
85  int top = 0, float threshold = 0.0) const = 0;
86 
87 
96  virtual void similarityByFeature(std::vector<float> &feature_1, std::vector <std::vector<float> > &feature_n, std::vector<float> &out_simi) const = 0;
97 
98 
106  virtual float similarityMaxByFeature(std::vector<float> &feature_1, std::vector<std::vector<float> > &feature_n) const = 0;
107 
108 
118  virtual float similarityMaxByFeature(float *feature_1, float **feature_n, int feature_count, int feature_size = 512) const = 0;
119 
120 
134  virtual void similarityByFeatureSort(float *feature_1, float **feature_n, int feature_count, std::vector<int> &idx_n, std::vector<float> &out_simi, std::vector<int> &out_idx, int feature_size = 512, int top = 0, float threshold = 0.0) const= 0;
135 
136 
147  virtual void similarityByFeature(float *feature_1, float **feature_n, int feature_count, std::vector<float> &out_simi, int feature_size = 512) const= 0;
148 
149 
155  virtual void SetNumThreads(int numThreads) = 0;
156 
157 
163  virtual void SetAccuracy(int accuracy) = 0;
164 
165 
170  virtual int GetNumThreads() const= 0;
171 
172  };
173 
179  typedef DfaceCompare* CreateCompare();
180 
185  typedef void DestroyCompare(DfaceCompare* dc);
186 
187 }
188 
189 
190 
191 #endif //DFACE_C_H
Definition: allocator.h:14
DFace人脸比对API抽象层(DFaceCompare)
Definition: dface_compare.h:40