Face Engine SDK  4.9.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 
20  enum class MedicalMask {
21  Mask = 0,
22  NoMask,
24  };
25 
30  enum class MedicalMaskExtended {
31  Mask = 0,
32  NoMask,
35  };
36 
41  enum class DetailedMaskType {
42  CorrectMask = 0,
44  ClearFace,
47  FullMask,
48  Count
49  };
50 
60 
61  // scores
62  float maskScore;
63  float noMaskScore;
65 
66  float scores[static_cast<int>(DetailedMaskType::Count)];
67 
73  inline float getScore(DetailedMaskType type) const;
74  };
75 
84  // scores
85  float maskScore;
86  float noMaskScore;
89  };
90 
96 
103  virtual Result<FSDKError>
104  estimate(
105  const Image& warp,
106  MedicalMaskEstimation& estimation) const noexcept = 0;
107 
114  virtual Result<FSDKError>
115  estimate(
116  const Image& warp,
117  MedicalMaskEstimationExtended& estimation) const noexcept = 0;
118 
126  virtual Result<FSDKError>
127  estimate(
128  const Image& image,
129  const Detection& detection,
130  MedicalMaskEstimation& estimation) const noexcept = 0;
131 
139  virtual Result<FSDKError>
140  estimate(
141  const Image& image,
142  const Detection& detection,
143  MedicalMaskEstimationExtended& estimation) const noexcept = 0;
144 
153  virtual Result<FSDKError>
154  estimate(
155  Span<const Image> warps,
156  Span<MedicalMaskEstimation> estimations) const noexcept = 0;
157 
166  virtual Result<FSDKError>
167  estimate(
168  Span<const Image> warps,
169  Span<MedicalMaskEstimationExtended> estimations) const noexcept = 0;
170 
180  virtual Result<FSDKError>
181  estimate(
182  Span<const Image> images,
183  Span<const Detection> detections,
184  Span<MedicalMaskEstimation> estimations) const noexcept = 0;
185 
195  virtual Result<FSDKError>
196  estimate(
197  Span<const Image> images,
198  Span<const Detection> detections,
199  Span<MedicalMaskEstimationExtended> estimations) const noexcept = 0;
200  };
201 
202  /*
203  Implementation details.
204  */
206  switch (type) {
213  return scores[static_cast<int>(type)];
214  default:
215  return 0.f;
216  }
217  }
218 
219 } // namespace fsdk
clear face - no mask on the face
no medical mask on the face
mask is not on the right place
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
correct mask on the face (mouth and nose are covered correctly)
Common data types and structures.
medical mask is on the face
face is covered with not a medical mask or a full mask
MedicalMaskExtended
MedicalMask estimator output enum. This enum contains all possible extended estimation results...
Definition: IMedicalMaskEstimator.h:30
Object system types and interfaces.
float occludedFaceScore
face is occluded by something score
Definition: IMedicalMaskEstimator.h:88
Common SDK error codes.
float noMaskScore
no medical mask on the face score
Definition: IMedicalMaskEstimator.h:63
MedicalMask result
estimation result (
Definition: IMedicalMaskEstimator.h:58
Base strong reference counted object interface.
Definition: IRefCounted.h:36
float noMaskScore
no medical mask on the face score
Definition: IMedicalMaskEstimator.h:86
DetailedMaskType
MedicalMask estimator output enum. This enum contains all type of DetailedMaskType results...
Definition: IMedicalMaskEstimator.h:41
float occludedFaceScore
face is occluded by something score
Definition: IMedicalMaskEstimator.h:64
float getScore(DetailedMaskType type) const
Returns score of required detailed mask type.
Definition: IMedicalMaskEstimator.h:205
MedicalMask estimator interface.
Definition: IMedicalMaskEstimator.h:95
float maskScore
medical mask is on the face score
Definition: IMedicalMaskEstimator.h:85
MedicalMask estimator output structure. This structure contains the result of estimation (...
Definition: IMedicalMaskEstimator.h:82
float maskNotInPlace
mask is not on the right place
Definition: IMedicalMaskEstimator.h:87
clear face with a mask around of a chin, mask does not cover anything in the face region (from mouth ...
Image.
Definition: Image.h:38
MedicalMask estimator output structure. This structure contains the result of estimation (...
Definition: IMedicalMaskEstimator.h:57
virtual Result< FSDKError > estimate(const Image &warp, MedicalMaskEstimation &estimation) const noexcept=0
Estimate MedicalMask probabilities.
MedicalMask
MedicalMask estimator output enum. This enum contains all possible estimation results.
Definition: IMedicalMaskEstimator.h:20
float maskScore
medical mask is on the face score
Definition: IMedicalMaskEstimator.h:62
MedicalMaskExtended result
estimation result (
Definition: IMedicalMaskEstimator.h:83
DetailedMaskType maskType
detailed type (
Definition: IMedicalMaskEstimator.h:59
face is covered with a full mask (such as balaclava, sky mask, etc.)
face is occluded by something
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:13
float scores[static_cast< int >(DetailedMaskType::Count)]
detailed estimation scores
Definition: IMedicalMaskEstimator.h:66
Face detection. Stores a detected face bounding box within a source image frame as well as detection...
Definition: Detection.h:10