Face Engine SDK  5.14.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IMedicalMaskEstimator.h
1 #pragma once
2 
3 #pragma once
4 
5 #include <fsdk/IObject.h>
6 #include <fsdk/FSDKError.h>
7 #include <fsdk/Optional.h>
8 #include <fsdk/Types.h>
9 
10 namespace fsdk {
11 
12 #ifndef DOXYGEN_SHOULD_SKIP_THIS
13  DECLARE_SMARTPTR(IMedicalMaskEstimator);
14 #endif
15 
25  enum class MedicalMask {
26  Mask = 0,
27  NoMask,
29  };
30 
35  enum class MedicalMaskExtended {
36  Mask = 0,
37  NoMask,
40  };
41 
46  enum class DetailedMaskType {
47  CorrectMask = 0,
49  ClearFace,
52  FullMask,
53  Count
54  };
55 
65 
66  // scores
67  float maskScore;
68  float noMaskScore;
70 
71  float scores[static_cast<int>(DetailedMaskType::Count)];
72 
78  inline float getScore(DetailedMaskType type) const;
79  };
88  // scores
89  float maskScore;
90  float noMaskScore;
93  };
94 
108  virtual Result<FSDKError>
109  estimate(
110  const Image& warp,
111  MedicalMaskEstimation& estimation) const noexcept = 0;
112 
121  virtual Result<FSDKError>
122  estimate(
123  const Image& warp,
124  MedicalMaskEstimationExtended& estimation) const noexcept = 0;
125 
135  virtual Result<FSDKError>
136  estimate(
137  const Image& image,
138  const Detection& detection,
139  MedicalMaskEstimation& estimation) const noexcept = 0;
140 
150  virtual Result<FSDKError>
151  estimate(
152  const Image& image,
153  const Detection& detection,
154  MedicalMaskEstimationExtended& estimation) const noexcept = 0;
155 
166  virtual Result<FSDKError> estimate(
167  Span<const Image> warps,
168  Span<MedicalMaskEstimation> estimations) const noexcept = 0;
169 
180  virtual Result<FSDKError> estimate(
181  Span<const Image> warps,
182  Span<MedicalMaskEstimationExtended> estimations) const noexcept = 0;
183 
195  virtual Result<FSDKError> estimate(
196  Span<const Image> images,
197  Span<const Detection> detections,
198  Span<MedicalMaskEstimation> estimations) const noexcept = 0;
199 
211  virtual Result<FSDKError> estimate(
212  Span<const Image> images,
213  Span<const Detection> detections,
214  Span<MedicalMaskEstimationExtended> estimations) const noexcept = 0;
225  virtual Result<FSDKError>
226  validate(
227  Span<const Image> warps,
228  Span<Result<FSDKError>> errors) const noexcept = 0;
229 
241  virtual Result<FSDKError>
242  validate(
243  Span<const Image> images,
244  Span<const Detection> detections,
245  Span<Result<FSDKError>> errors) const noexcept = 0;
246  };
247 
248  /*
249  Implementation details.
250  */
252  switch (type) {
259  return scores[static_cast<int>(type)];
260  default:
261  return 0.f;
262  }
263  }
265 } // namespace fsdk
face is covered with not a medical mask or a full mask
virtual Result< FSDKError > validate(Span< const Image > warps, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
DetailedMaskType
MedicalMask estimator output enum. This enum contains all type of DetailedMaskType results...
Definition: IMedicalMaskEstimator.h:46
Common data types and structures.
MedicalMask
MedicalMask estimator output enum. This enum contains all possible estimation results.
Definition: IMedicalMaskEstimator.h:25
correct mask on the face (mouth and nose are covered correctly)
Object system types and interfaces.
float getScore(DetailedMaskType type) const
Returns score of required detailed mask type.
Definition: IMedicalMaskEstimator.h:251
float occludedFaceScore
face is occluded by something score
Definition: IMedicalMaskEstimator.h:92
Common SDK error codes.
float noMaskScore
no medical mask on the face score
Definition: IMedicalMaskEstimator.h:68
MedicalMask result
estimation result (
Definition: IMedicalMaskEstimator.h:63
clear face with a mask around of a chin, mask does not cover anything in the face region (from mouth ...
Base strong reference counted object interface.
Definition: IRefCounted.h:36
float noMaskScore
no medical mask on the face score
Definition: IMedicalMaskEstimator.h:90
float occludedFaceScore
face is occluded by something score
Definition: IMedicalMaskEstimator.h:69
MedicalMask estimator interface.
Definition: IMedicalMaskEstimator.h:99
float maskScore
medical mask is on the face score
Definition: IMedicalMaskEstimator.h:89
MedicalMask estimator output structure. This structure contains the result of estimation (...
Definition: IMedicalMaskEstimator.h:86
float maskNotInPlace
mask is not on the right place
Definition: IMedicalMaskEstimator.h:91
medical mask is on the face
face is occluded by something
MedicalMaskExtended
MedicalMask estimator output enum. This enum contains all possible extended estimation results...
Definition: IMedicalMaskEstimator.h:35
Image.
Definition: Image.h:39
MedicalMask estimator output structure. This structure contains the result of estimation (...
Definition: IMedicalMaskEstimator.h:62
virtual Result< FSDKError > estimate(const Image &warp, MedicalMaskEstimation &estimation) const noexcept=0
Estimate MedicalMask probabilities.
float maskScore
medical mask is on the face score
Definition: IMedicalMaskEstimator.h:67
MedicalMaskExtended result
estimation result (
Definition: IMedicalMaskEstimator.h:87
DetailedMaskType maskType
detailed type (
Definition: IMedicalMaskEstimator.h:64
mask is not on the right place
face is covered with a full mask (such as balaclava, sky mask, etc.)
clear face - no mask on the face
Detection structure. Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14
float scores[static_cast< int >(DetailedMaskType::Count)]
detailed estimation scores
Definition: IMedicalMaskEstimator.h:71
no medical mask on the face