Face SDK  1.8.0 Mozart beta
Face Recognition Software Development Kit
fir_matcher.h
1 
4 #ifndef FACE_SDK_FIR_MATCHER_H
5 #define FACE_SDK_FIR_MATCHER_H
6 
7 #include <face_sdk_base/export.h>
8 
9 #include <face_sdk_base/data_container.h>
10 #include <face_sdk_base/fir.h>
11 #include <face_sdk_base/license.h>
12 #include <face_sdk_fir_matcher/fir_list.h>
13 
14 namespace face_sdk
15 {
16 
23  typedef std::tuple<uint32_t, float> match;
24 
25  typedef std::vector<match> matches;
26 
27  enum match_fields
28  {
29  FIR_INDEX = 0,
30  MATCH_SCORE = 1
31  };
32 
33 
36  enum class architecture_type
37  {
38  COMMON = 0, // Common architecture. Standard type that use for compute matches.
39  NUMA // NUMA architecture. Prefer to use for compute matches on machine with NUMA.
40  };
41 
47  {
48  public:
49 
56  virtual float match(const std::shared_ptr<face_sdk::fir> &fir_l, const std::shared_ptr<face_sdk::fir> &fir_r) = 0;
57 
64  virtual float match(const std::shared_ptr<face_sdk::fir_list> &fir_list, uint32_t idx, const std::shared_ptr<face_sdk::fir> &fir) = 0;
65 
68  virtual uint32_t builder_version() const noexcept = 0;
69 
72  virtual std::string far_table_code() const noexcept = 0;
73 
80  virtual std::vector<float> match(const std::shared_ptr<face_sdk::fir> &fir, const std::shared_ptr<face_sdk::fir_list> &fir_list) = 0;
81 
88  virtual matches best_matches(
89  const std::shared_ptr<face_sdk::fir> &fir,
90  const std::shared_ptr<face_sdk::fir_list> &fir_list,
91  float threshold, uint32_t max_matches) = 0;
92 
100  virtual matches best_matches(
101  const std::vector< std::shared_ptr<face_sdk::fir> > &firs,
102  const std::shared_ptr<face_sdk::fir_list> &fir_list,
103  float threshold, uint32_t max_matches) = 0;
104  };
105 
109  bool FACE_SDK_EXPORT is_architecture_available(const architecture_type type);
110 
121  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
122  uint32_t builder_version,
123  const std::string &table_code,
124  const std::shared_ptr<face_sdk::license> &license,
125  const std::shared_ptr<face_sdk::data_container> &container,
126  const architecture_type type);
127 
128 
138  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
139  uint32_t builder_version,
140  const std::string &table_code,
141  const std::shared_ptr<face_sdk::license> &license,
142  const std::shared_ptr<face_sdk::data_container> &container);
143 
152  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
153  uint32_t builder_version,
154  const std::string &table_code,
155  const std::shared_ptr<face_sdk::license> &license);
156 
165  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
166  uint32_t builder_version,
167  const std::string &table_code,
168  const std::shared_ptr<face_sdk::data_container> &data_container);
169 
177  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
178  uint32_t builder_version,
179  const std::string &table_code);
180 
187  float FACE_SDK_EXPORT score_to_percentage(float score);
188 
195  float FACE_SDK_EXPORT percentage_to_score(float percentage);
196 
198 }
199 
200 
201 #endif //FACE_SDK_FIR_MATCHER_H
virtual matches best_matches(const std::shared_ptr< face_sdk::fir > &fir, const std::shared_ptr< face_sdk::fir_list > &fir_list, float threshold, uint32_t max_matches)=0
Performs 1:N matching operations for specified FIRs and returns top matches results.
virtual float match(const std::shared_ptr< face_sdk::fir > &fir_l, const std::shared_ptr< face_sdk::fir > &fir_r)=0
Performs 1:1 matching operations for specified FIRs.
architecture_type
Matcher architecture type.
Definition: fir_matcher.h:36
virtual uint32_t builder_version() const noexcept=0
Builder algorithm version which was selected for FIRs matcher initialization.
float percentage_to_score(float percentage)
Converts percentage to score.
List of FIRs for matching.
Definition: fir_list.h:22
Definition: alignment_info.h:8
The FIR object. FIR - Face Identification Record, biometric template.
Definition: fir.h:23
bool is_architecture_available(const architecture_type type)
Checks for architecture availability.
The data container object. The data container helps face_sdk to manage a data.
Definition: data_container.h:23
float score_to_percentage(float score)
Converts score to percentage. {#fir_matcher_score_to_percentage}.
Fir matcher compares FIRs against each other. Matcher can perform 1:1 and 1:N matching.
Definition: fir_matcher.h:46
The license object. A license object provides information about your limits in face_sdk. See Licensing.
Definition: license.h:26
virtual std::string far_table_code() const noexcept=0
Returns FAR table code which was selected for FIRs matcher initialization. See Matching table codes...
std::shared_ptr< face_sdk::fir_matcher > make_fir_matcher(uint32_t builder_version, const std::string &table_code)
Makes FIRs matcher with specified builder version, FAR table. The license and data container will be ...