Face Engine SDK  5.21.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(const Image& warp, EstimationResult& estimation) const noexcept = 0;
41 
42  virtual Result<FSDKError>
43  estimate(Span<const Image> warps, Span<EstimationResult> estimations) const noexcept = 0;
44  };
45 
46  float
47  IEthnicityEstimator::EstimationResult::getEthnicityScore(IEthnicityEstimator::Ethnicities ethnicity) const {
48  if(static_cast<uint32_t>(ethnicity) >= static_cast<uint32_t>(IEthnicityEstimator::Ethnicities::Other)) {
49  return 0;
50  }
51  return scores[static_cast<uint32_t>(ethnicity)];
52  }
53 
55 } // namespace fsdk
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:56
Definition: IEthnicityEstimator.h:18
A structure that encapsulates an action result enumeration.
Definition: Result.h:27
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:37
Image.
Definition: Image.h:38
float getEthnicityScore(Ethnicities ethnicity) const
the result ethnicity
Definition: IEthnicityEstimator.h:47
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