Face SDK  1.14.1 Mozart release
Face Recognition Software Development Kit
quality_checker.h
1 #pragma once
2 
3 #include <face_sdk_base/export.h>
4 
5 #include <face_sdk_alignment/alignment.h>
6 #include <face_sdk_base/license.h>
7 #include <face_sdk_base/data_container.h>
8 
9 #include <string>
10 
11 namespace face_sdk
12 {
29  {
30  float hot_spots;
31  float blur;
32  float overexposure;
33  float rotation;
34  float glasses;
35  float smile;
36  float occlusion;
37  float closed_eyes;
38  float red_left_eye;
39  float red_right_eye;
40  float face_color;
41  float background;
42  float mask;
43  };
44 
45  typedef std::vector<quality_check_result> quality_check_result_set;
46 
52  {
53  public:
54  virtual ~quality_checker() = default;
55 
62  virtual quality_check_result_set check_faces(const face_set &faces) = 0;
63 
66  virtual bool is_compatible(uint32_t detector_version) const = 0;
67  };
68 
73  {
74  bool use_blur_checker = true;
75  bool use_face_color_checker = true;
77  bool use_hot_spots_checker = true;
79  bool use_red_eyes_checker = true;
80  bool use_rotation_checker = true;
81  bool use_background_checker = true;
82  bool use_mask_checker = true;
83 
84  std::shared_ptr<face_sdk::data_container> face_color_container = nullptr;
85  std::shared_ptr<face_sdk::data_container> glasses_smile_occlusion_container = nullptr;
86  std::shared_ptr<face_sdk::data_container> red_eyes_container = nullptr;
87  std::shared_ptr<face_sdk::data_container> background_container = nullptr;
88  std::shared_ptr<face_sdk::data_container> mask_container = nullptr;
89  };
90 
101  std::shared_ptr<quality_checker> FACE_SDK_EXPORT make_quality_checker(
102  uint32_t version,
103  const std::shared_ptr<face_sdk::license> &license,
104  const quality_checker_initializer &initializer,
105  uint32_t batch_size,
106  int32_t compute_device);
107 
117  std::shared_ptr<quality_checker> FACE_SDK_EXPORT make_quality_checker(
118  uint32_t version,
119  const quality_checker_initializer &initializer,
120  uint32_t batch_size,
121  int32_t compute_device);
122 
134  std::shared_ptr<quality_checker> FACE_SDK_EXPORT make_quality_checker(
135  uint32_t version,
136  const std::shared_ptr<face_sdk::license> &license,
137  uint32_t batch_size,
138  int32_t compute_device);
139 
140 
151  std::shared_ptr<quality_checker> FACE_SDK_EXPORT make_quality_checker(
152  uint32_t version,
153  uint32_t batch_size,
154  int32_t compute_device);
155 
157 }
float smile
value in range [0...1], where 0 means no smile and 1 means a smile.
Definition: quality_checker.h:35
virtual quality_check_result_set check_faces(const face_set &faces)=0
The function calculates images quality of the given face_set.
bool use_rotation_checker
rotation will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate field...
Definition: quality_checker.h:80
float rotation
value in range [0...1], where 0 means face on image is not rotated and 1 means it is rotated...
Definition: quality_checker.h:33
virtual bool is_compatible(uint32_t detector_version) const =0
Function helps you to determine Quality and Face Detector algorithms versions compatibility. See versions_compatibility.
Quality checker algorithm. Calculates quality of the given face_set.
Definition: quality_checker.h:51
float glasses
value in range [0...1], where 0 means no glasses and 1 means glasses on.
Definition: quality_checker.h:34
float face_color
value in range [0...1], where 0 means the skin color is normal and 1 means the color is unnatural...
Definition: quality_checker.h:40
float blur
value in range [0...1], where 0 means no blur and 1 means blurred image.
Definition: quality_checker.h:31
bool use_hot_spots_checker
hot spots will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate field...
Definition: quality_checker.h:77
bool use_background_checker
background evenness will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate...
Definition: quality_checker.h:81
bool use_overexposure_checker
overexposure will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate field...
Definition: quality_checker.h:78
std::shared_ptr< face_sdk::data_container > glasses_smile_occlusion_container
The container with glasses_smile_occlusion algorithm data. Can be nullptr if use_glasses_smile_occlus...
Definition: quality_checker.h:85
Definition: alignment_info.h:8
std::shared_ptr< face_sdk::data_container > background_container
The container with background algorithm data. Can be nullptr if use_background_checker == false...
Definition: quality_checker.h:87
float closed_eyes
value in range [0...1], where 0 means eyes are open and 1 means eyes are closed.
Definition: quality_checker.h:37
bool use_mask_checker
mask will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate field...
Definition: quality_checker.h:82
bool use_blur_checker
blur will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate field...
Definition: quality_checker.h:74
float occlusion
value in range [0...1], where 0 means no occlusion and 1 means face is fully blocked.
Definition: quality_checker.h:36
bool use_face_color_checker
unnatural skin color will be calculated if true, otherwise nan will be in quality_result&#39;s appropriat...
Definition: quality_checker.h:75
float hot_spots
value in range [0...1], where 0 means no hot spots and 1 means heavy hot spots.
Definition: quality_checker.h:30
std::shared_ptr< face_sdk::data_container > mask_container
The container with mask algorithm data. Can be nullptr if use_mask_checker == false.
Definition: quality_checker.h:88
The license object. A license object provides information about your limits in face_sdk. See Licensing.
Definition: license.h:27
float overexposure
value in range [0...1], where 0 means normal exposure and 1 means under/overexposed image...
Definition: quality_checker.h:32
std::shared_ptr< face_sdk::data_container > face_color_container
The container with face_color algorithm data. Can be nullptr if use_face_color_checker == false...
Definition: quality_checker.h:84
float background
value in range [0...1], where 0 means the background is even and 1 means the background is not even...
Definition: quality_checker.h:41
std::shared_ptr< quality_checker > make_quality_checker(uint32_t version, uint32_t batch_size, int32_t compute_device)
Makes the face_sdk::quality_checker object with needed version, batch size and compute device...
bool use_glasses_smile_occlusion_checker
glasses, smile, occlusion and closed eyes will be calculated if true, otherwise nan will be in qualit...
Definition: quality_checker.h:76
float red_right_eye
value in range [0...1], where 0 means normal eye color and 1 means red eye.
Definition: quality_checker.h:39
float mask
value in range [0...1], where 0 means no mask and 1 means there is a mask.
Definition: quality_checker.h:42
float red_left_eye
value in range [0...1], where 0 means normal eye color and 1 means red eye.
Definition: quality_checker.h:38
std::shared_ptr< face_sdk::data_container > red_eyes_container
The container with red_eyes algorithm data. Can be nullptr if use_red_eyes_checker == false...
Definition: quality_checker.h:86
Contains information about quality_checker modules you want to initialize.
Definition: quality_checker.h:72
Contains information about quality of the image.
Definition: quality_checker.h:28
bool use_red_eyes_checker
red eyes will be calculated if true, otherwise nan will be in quality_result&#39;s appropriate field...
Definition: quality_checker.h:79