Face SDK  1.14.1 Mozart release
Face Recognition Software Development Kit
fir_matcher.h
1 
4 #pragma once
5 
6 #include <face_sdk_base/export.h>
7 
8 #include <face_sdk_base/data_container.h>
9 #include <face_sdk_base/fir.h>
10 #include <face_sdk_base/license.h>
11 #include <face_sdk_fir_matcher/fir_list.h>
12 
13 namespace face_sdk
14 {
15 
22  typedef std::tuple<uint32_t, float> match;
23 
24  typedef std::vector<match> matches;
25 
26  enum match_fields
27  {
28  FIR_INDEX = 0,
29  MATCH_SCORE = 1
30  };
31 
32 
35  enum class architecture_type
36  {
37  COMMON = 0, // Common architecture. Standard type that use for compute matches.
38  NUMA // NUMA architecture. Prefer to use for compute matches on machine with NUMA.
39  };
40 
46  {
47  public:
48 
55  virtual float match(const std::shared_ptr<face_sdk::fir> &fir_l, const std::shared_ptr<face_sdk::fir> &fir_r) = 0;
56 
63  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;
64 
67  virtual uint32_t builder_version() const noexcept = 0;
68 
71  virtual std::string far_table_code() const noexcept = 0;
72 
79  virtual std::vector<float> match(const std::shared_ptr<face_sdk::fir> &fir, const std::shared_ptr<face_sdk::fir_list> &fir_list) = 0;
80 
87  virtual matches best_matches(
88  const std::shared_ptr<face_sdk::fir> &fir,
89  const std::shared_ptr<face_sdk::fir_list> &fir_list,
90  float threshold, uint32_t max_matches) = 0;
91 
99  virtual matches best_matches(
100  const std::vector< std::shared_ptr<face_sdk::fir> > &firs,
101  const std::shared_ptr<face_sdk::fir_list> &fir_list,
102  float threshold, uint32_t max_matches) = 0;
103  };
104 
108  bool FACE_SDK_EXPORT is_architecture_available(const architecture_type type);
109 
120  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
121  uint32_t builder_version,
122  const std::string &table_code,
123  const std::shared_ptr<face_sdk::license> &license,
124  const std::shared_ptr<face_sdk::data_container> &container,
125  const architecture_type type);
126 
127 
137  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
138  uint32_t builder_version,
139  const std::string &table_code,
140  const std::shared_ptr<face_sdk::license> &license,
141  const std::shared_ptr<face_sdk::data_container> &container);
142 
151  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
152  uint32_t builder_version,
153  const std::string &table_code,
154  const std::shared_ptr<face_sdk::license> &license);
155 
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::license> &license,
169  const architecture_type type);
170 
179  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
180  uint32_t builder_version,
181  const std::string &table_code,
182  const std::shared_ptr<face_sdk::data_container> &data_container);
183 
193  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
194  uint32_t builder_version,
195  const std::string &table_code,
196  const std::shared_ptr<face_sdk::data_container> &data_container,
197  const architecture_type type);
198 
207  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
208  uint32_t builder_version,
209  const std::string &table_code);
210 
220  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
221  uint32_t builder_version,
222  const std::string &table_code,
223  const architecture_type type);
224 
231  float FACE_SDK_EXPORT score_to_percentage(float score);
232 
239  float FACE_SDK_EXPORT percentage_to_score(float percentage);
240 
242 }
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.
std::shared_ptr< face_sdk::fir_matcher > make_fir_matcher(uint32_t builder_version, const std::string &table_code, const architecture_type type)
Makes FIRs matcher with specified builder version, FAR table. The license and data container will be ...
architecture_type
Matcher architecture type.
Definition: fir_matcher.h:35
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:45
The license object. A license object provides information about your limits in face_sdk. See Licensing.
Definition: license.h:27
virtual std::string far_table_code() const noexcept=0
Returns FAR table code which was selected for FIRs matcher initialization. See Matching table codes...