Face Engine SDK  5.8.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IPPEEstimator.h
1 #pragma once
2 
3 #include <fsdk/IObject.h>
4 #include <fsdk/FSDKError.h>
5 #include <fsdk/Optional.h>
6 #include <fsdk/Types.h>
7 
8 #include <algorithm>
9 
10 namespace fsdk {
11 
12 #ifndef DOXYGEN_SHOULD_SKIP_THIS
13  DECLARE_SMARTPTR(IPPEEstimator);
14 #endif
15 
25  float positive = 0.0f;
26  float negative = 0.0f;
27  float unknown = 0.0f;
28 
29  enum class PPEState : uint8_t {
30  Positive,
31  Negative,
32  Unknown,
33  Count
34  };
35 
40  };
41  using PPEState = OnePPEEstimation::PPEState;
42 
51  struct PPEEstimation {
52  OnePPEEstimation helmetEstimation;
53  OnePPEEstimation hoodEstimation;
54  OnePPEEstimation vestEstimation;
55  OnePPEEstimation glovesEstimation;
56  };
57 
72  estimate(
73  const Image& image,
74  const Detection& detection) const noexcept = 0;
75  };
76 
78  float* arr = &this->positive;
79  return static_cast<PPEState>(
80  std::distance(arr, std::max_element(arr, arr + static_cast<int>(PPEState::Count)))
81  );
82  }
83 } // namespace fsdk
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
Personal Protection Equipment estimation structure (a.k.a. PPE) This structure contains prediction sc...
Definition: IPPEEstimator.h:24
Personal Protection Equipment estimator interface.
Definition: IPPEEstimator.h:62
Common data types and structures.
virtual ResultValue< FSDKError, PPEEstimation > estimate(const Image &image, const Detection &detection) const noexcept=0
estimate PPE.
Object system types and interfaces.
person is wearing specific personal equipment;
Common SDK error codes.
Base strong reference counted object interface.
Definition: IRefCounted.h:36
PPEState
Definition: IPPEEstimator.h:29
Addon for Result to output some value aside the result. Specialization for copiable types...
Definition: ResultValue.h:25
person isn&#39;t wearing specific personal equipment;
Image.
Definition: Image.h:38
it&#39;s hard to tell wether person wears specific personal equipment.
PPEState getPredominantState()
returns predominant personal equipment state
Definition: IPPEEstimator.h:77
Detection structure. Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
Personal Protection Equipment output structure. This structure aggregates multiple PPE attributes pre...
Definition: IPPEEstimator.h:51