DFace SDK  1.8.5
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 
52  virtual float similarityByFeature(std::vector<float> &feature_1, std::vector<float> &feature_2) const = 0;
53 
54 
63  virtual float similarityByFeature(float *feature_1, float *feature_2, int feature_size = 512) const = 0;
64 
65 
77  virtual void similarityByFeatureSort(std::vector<float> &feature_1, std::vector <std::vector<float> > &feature_n, std::vector<unsigned int> &idx_n, std::vector<float> &out_simi, std::vector<unsigned int> &out_idx,
78  int top = 0, float threshold = 0.0) const = 0;
79 
80 
89  virtual void similarityByFeature(std::vector<float> &feature_1, std::vector <std::vector<float> > &feature_n, std::vector<float> &out_simi) const = 0;
90 
91 
99  virtual float similarityMaxByFeature(std::vector<float> &feature_1, std::vector<std::vector<float> > &feature_n) const = 0;
100 
101 
111  virtual float similarityMaxByFeature(float *feature_1, float **feature_n, int feature_count, int feature_size = 512) const = 0;
112 
113 
127  virtual void similarityByFeatureSort(float *feature_1, float **feature_n, int feature_count, std::vector<unsigned int> &idx_n, std::vector<float> &out_simi, std::vector<unsigned int> &out_idx, int feature_size = 512, int top = 0, float threshold = 0.0) const= 0;
128 
129 
140  virtual void similarityByFeature(float *feature_1, float **feature_n, int feature_count, std::vector<float> &out_simi, int feature_size = 512) const= 0;
141 
142 
148  virtual void SetNumThreads(int numThreads) = 0;
149 
150 
156  virtual void SetAccuracy(int accuracy) = 0;
157 
158 
163  virtual int GetNumThreads() const= 0;
164 
165  };
166 
172  typedef DfaceCompare* CreateCompare(string model_path, int accuracy);
173 
178  typedef void DestroyCompare(DfaceCompare* dc);
179 
180 }
181 
182 
183 
184 #endif //DFACE_C_H
Definition: common.h:37
DFace人脸比对API抽象层(DFaceCompare)
Definition: dface_compare.h:40