Face Engine SDK  5.13.0
A face detection, recognition and tracking engine.
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 
14  enum class Ethnicities {
15  Black = 0,
16  Indian,
17  Asian,
18  White,
19  Arab,
20  Pamir,
21  Kavkaz,
22  Other
23  };
24 
26  inline float getEthnicityScore(Ethnicities ethnicity) const;
27 
29  Ethnicities predominant;
32  float scores[static_cast<int>(Ethnicities::Other)];
33  };
34 
35  virtual Result<FSDKError> estimate(
36  const Image& warp,
37  EstimationResult& estimation) const noexcept = 0;
38 
39  virtual Result<FSDKError> estimate(
40  Span<const Image> warps,
41  Span<EstimationResult> estimations) const noexcept = 0;
42  };
43 
44 
45  float
46  IEthnicityEstimator::EstimationResult::getEthnicityScore(IEthnicityEstimator::Ethnicities ethnicity ) const {
47  if (static_cast<uint32_t>(ethnicity) >= static_cast<uint32_t>(IEthnicityEstimator::Ethnicities::Other)) {
48  return 0;
49  }
50  return scores[static_cast<uint32_t>(ethnicity)];
51  }
52 
53 } // namespace fsdk
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
SDK namespace.
Definition: IAGSEstimator.h:8
Definition: IEthnicityEstimator.h:13
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
Common data types and structures.
float getEthnicityScore(Ethnicities ethnicity) const
the result ethnicity
Definition: IEthnicityEstimator.h:46
Ethnicities predominant
Definition: IEthnicityEstimator.h:29
Object system types and interfaces.
Common SDK error codes.
Base strong reference counted object interface.
Definition: IRefCounted.h:36
Image.
Definition: Image.h:38
Definition: IEthnicityEstimator.h:25
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14