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
IEthnicityEstimator.h
1 #pragma once
2 
3 #include <fsdk/FSDKError.h>
4 #include <fsdk/IObject.h>
5 #include <fsdk/Types.h>
6 
7 namespace fsdk {
8 
9 #ifndef DOXYGEN_SHOULD_SKIP_THIS
10  DECLARE_SMARTPTR(IEthnicityEstimator);
11 #endif
12 
19  enum class Ethnicities {
20  Black = 0,
21  Indian,
22  Asian,
23  White,
24  Arab,
25  Pamir,
26  Kavkaz,
27  Other
28  };
29 
31  inline float getEthnicityScore(Ethnicities ethnicity) const;
32 
34  Ethnicities predominant;
37  float scores[static_cast<int>(Ethnicities::Other)];
38  };
39 
40  virtual Result<FSDKError> estimate(
41  const Image& warp,
42  EstimationResult& estimation) const noexcept = 0;
43 
44  virtual Result<FSDKError> estimate(
45  Span<const Image> warps,
46  Span<EstimationResult> estimations) const noexcept = 0;
47  };
48 
49 
50  float
51  IEthnicityEstimator::EstimationResult::getEthnicityScore(IEthnicityEstimator::Ethnicities ethnicity ) const {
52  if (static_cast<uint32_t>(ethnicity) >= static_cast<uint32_t>(IEthnicityEstimator::Ethnicities::Other)) {
53  return 0;
54  }
55  return scores[static_cast<uint32_t>(ethnicity)];
56  }
58 } // namespace fsdk
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
Definition: IEthnicityEstimator.h:18
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
Common data types and structures.
Ethnicities predominant
Definition: IEthnicityEstimator.h:34
Object system types and interfaces.
Common SDK error codes.
Base strong reference counted object interface.
Definition: IRefCounted.h:36
Image.
Definition: Image.h:39
float getEthnicityScore(Ethnicities ethnicity) const
the result ethnicity
Definition: IEthnicityEstimator.h:51
Definition: IEthnicityEstimator.h:30
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14