Face SDK  1.7 Mozart rc
Face Recognition Software Development Kit
fir_matcher.h
Go to the documentation of this file.
1 
4 #ifndef FACE_SDK_FIR_MATCHER_H
5 #define FACE_SDK_FIR_MATCHER_H
6 
8 #include <face_sdk_base/export.h>
9 #include <face_sdk_base/fir.h>
10 #include <face_sdk_base/license.h>
12 
13 namespace face_sdk
14 {
15 
22  typedef std::vector< std::tuple<uint32_t, float> > matches;
23 
24  enum match
25  {
26  FIR_INDEX = 0,
27  MATCH_SCRORE = 1
28  };
29 
30 
33  enum class architecture_type
34  {
35  COMMON = 0, // Common architecture. Standard type that use for compute matches.
36  NUMA // NUMA architecture. Prefer to use for compute matches on machine with NUMA.
37  };
38 
44  {
45  public:
46 
53  virtual float match(const std::shared_ptr<face_sdk::fir> &fir_l, const std::shared_ptr<face_sdk::fir> &fir_r) = 0;
54 
61  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;
62 
65  virtual uint32_t builder_version() const noexcept = 0;
66 
69  virtual std::string far_table_code() const noexcept = 0;
70 
77  virtual std::vector<float> match(const std::shared_ptr<face_sdk::fir> &fir, const std::shared_ptr<face_sdk::fir_list> &fir_list) = 0;
78 
85  virtual matches best_matches(
86  const std::shared_ptr<face_sdk::fir> &fir,
87  const std::shared_ptr<face_sdk::fir_list> &fir_list,
88  float threshold, uint32_t max_matches) = 0;
89 
97  virtual matches best_matches(
98  const std::vector< std::shared_ptr<face_sdk::fir> > &firs,
99  const std::shared_ptr<face_sdk::fir_list> &fir_list,
100  float threshold, uint32_t max_matches) = 0;
101  };
102 
106  bool FACE_SDK_EXPORT is_architecture_available(const architecture_type type);
107 
116  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
117  uint32_t builder_version,
118  const std::string &table_code,
119  const std::shared_ptr<face_sdk::license> &license,
120  const std::shared_ptr<face_sdk::data_container> &container,
121  const architecture_type type);
122 
123 
131  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
132  uint32_t builder_version,
133  const std::string &table_code,
134  const std::shared_ptr<face_sdk::license> &license,
135  const std::shared_ptr<face_sdk::data_container> &container);
136 
144  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
145  uint32_t builder_version,
146  const std::string &table_code,
147  const std::shared_ptr<face_sdk::license> &license);
148 
156  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
157  uint32_t builder_version,
158  const std::string &table_code,
159  const std::shared_ptr<face_sdk::data_container> &data_container);
160 
168  std::shared_ptr<face_sdk::fir_matcher> FACE_SDK_EXPORT make_fir_matcher(
169  uint32_t builder_version,
170  const std::string &table_code);
171 
178  float FACE_SDK_EXPORT score_to_percentage(float score);
179 
186  float FACE_SDK_EXPORT percentage_to_score(float percentage);
187 
189 }
190 
191 
192 #endif //FACE_SDK_FIR_MATCHER_H
face_sdk::is_architecture_available
bool FACE_SDK_EXPORT is_architecture_available(const architecture_type type)
Checks for architecture availability.
face_sdk::data_container
The data container object. The data containter helps face_sdk to manage a data.
Definition: data_container.h:19
face_sdk::fir
The FIR object. FIR - Face Identification Record, biometric template.
Definition: fir.h:23
face_sdk::fir_matcher::best_matches
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.
face_sdk::license
The license object. A license object provide information about your limits in face_sdk....
Definition: license.h:23
face_sdk::fir_matcher
The FIRs matcher. FIRs matcher compares FIRs to each other. It allows to perform 1:1 and 1:N matching...
Definition: fir_matcher.h:43
license.h
fir_list.h
face_sdk::fir_matcher::match
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.
fir.h
face_sdk::fir_list
List of FIRs for matching.
Definition: fir_list.h:21
face_sdk::architecture_type
architecture_type
Abstract factory for creation of matcher components (fir, fir_list, fir_matcher)
Definition: fir_matcher.h:33
face_sdk::fir_matcher::builder_version
virtual uint32_t builder_version() const noexcept=0
Builder algorithm version which was selected for FIRs matcher initialization.
data_container.h
face_sdk::fir_matcher::far_table_code
virtual std::string far_table_code() const noexcept=0
Returns FAR table code which was selected for FIRs matcher initialization. See Matching table codes.
face_sdk::score_to_percentage
float FACE_SDK_EXPORT score_to_percentage(float score)
Converts score to percentage. {#fir_matcher_score_to_percentage}.
face_sdk::percentage_to_score
float FACE_SDK_EXPORT percentage_to_score(float percentage)
Converts percentage to score.
face_sdk::make_fir_matcher
std::shared_ptr< face_sdk::fir_matcher > FACE_SDK_EXPORT 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 ...
export.h