| Face Engine SDK 5.33.0 A face detection, recognition and tracking engine.

Loading...
Searching...
No Matches
IFaceOcclusionEstimator.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 namespace fsdk {
9
10#ifndef DOXYGEN_SHOULD_SKIP_THIS
11 DECLARE_SMARTPTR(IFaceOcclusionEstimator);
12#endif
13
23 enum class FaceOcclusionType : uint8_t {
24 Forehead = 0,
25 LeftEye,
26 RightEye,
27 Nose,
28 Mouth,
29 LowerFace,
30 Count
31 };
32
37 enum class FaceOcclusionState : uint8_t {
38 NotOccluded = 0,
39 Occluded,
40 Count
41 };
42
50 struct FaceOcclusionEstimation {
51 FaceOcclusionState states[static_cast<uint8_t>(FaceOcclusionType::Count)];
52
54 float typeScores[static_cast<uint8_t>(FaceOcclusionType::Count)];
55
61 inline float getScore(FaceOcclusionType type) const {
62 return typeScores[static_cast<uint8_t>(type)];
63 }
64
70 inline FaceOcclusionState getState(FaceOcclusionType type) const {
71 return states[static_cast<uint8_t>(type)];
72 }
73
74 FaceOcclusionState overallOcclusionState;
75 float overallOcclusionScore;
76 float hairOcclusionScore;
77 };
78
83 struct IFaceOcclusionEstimator : IRefCounted {
92 virtual ResultValue<FSDKError, FaceOcclusionEstimation>
93 estimate(const Image& warp, const Landmarks5& landmarks5) const noexcept = 0;
94
107 virtual Result<FSDKError> estimate(
108 Span<const Image> warps,
109 Span<const Landmarks5> landmarks,
110 Span<FaceOcclusionEstimation> faceOcclusionEstimations) const noexcept = 0;
111
123 virtual Result<FSDKError> validate(
124 Span<const Image> warps,
125 Span<const Landmarks5> landmarks,
126 Span<Result<FSDKError>> errors) const noexcept = 0;
127 };
128
130} // namespace fsdk
fsdk::Span
Span. @detail Not owning data view. It incapsulated pointer to the continuous array with one or more ...
Definition Span.h:14
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition Def.h:56
fsdk::FaceOcclusionState
FaceOcclusionState
FaceOcclusionState enum. This enum contains all possible facial occlusion states.
Definition IFaceOcclusionEstimator.h:37
fsdk::FaceOcclusionType
FaceOcclusionType
FaceOcclusionType enum. This enum contains all possible facial occlusion types.
Definition IFaceOcclusionEstimator.h:23
fsdk::FaceOcclusionState::Occluded
@ Occluded
Face is occluded.
fsdk::FaceOcclusionState::NotOccluded
@ NotOccluded
Face is not occluded.
fsdk::FaceOcclusionType::Forehead
@ Forehead
Forehead.
fsdk::FaceOcclusionType::LowerFace
@ LowerFace
Lower part of the face (chin, mouth, etc.)
fsdk::FaceOcclusionType::Nose
@ Nose
Nose.
fsdk::FaceOcclusionType::RightEye
@ RightEye
Right eye.
fsdk::FaceOcclusionType::LeftEye
@ LeftEye
Left eye.
fsdk::FaceOcclusionType::Mouth
@ Mouth
Mouth.
fsdk::FaceOcclusionType::Count
@ Count
Total number of occlusion types.
fsdk
SDK namespace.
Definition IAGSEstimator.h:8
fsdk::FaceOcclusionEstimation
FaceOcclusionEstimation structure. This structure is used to check for occlusions in various parts of...
Definition IFaceOcclusionEstimator.h:50
fsdk::FaceOcclusionEstimation::getState
FaceOcclusionState getState(FaceOcclusionType type) const
Returns the occlusion state.
Definition IFaceOcclusionEstimator.h:70
fsdk::FaceOcclusionEstimation::getScore
float getScore(FaceOcclusionType type) const
Returns the occlusion score for the required facial zone.
Definition IFaceOcclusionEstimator.h:61
fsdk::FaceOcclusionEstimation::states
FaceOcclusionState states[static_cast< uint8_t >(FaceOcclusionType::Count)]
occlusion states
Definition IFaceOcclusionEstimator.h:51
fsdk::IFaceOcclusionEstimator
FaceOcclusion estimator interface.
Definition IFaceOcclusionEstimator.h:83
fsdk::IFaceOcclusionEstimator::estimate
virtual Result< FSDKError > estimate(Span< const Image > warps, Span< const Landmarks5 > landmarks, Span< FaceOcclusionEstimation > faceOcclusionEstimations) const noexcept=0
This structure is used to check for occlusions in various parts of the face (such as the lower face,...
fsdk::IFaceOcclusionEstimator::estimate
virtual ResultValue< FSDKError, FaceOcclusionEstimation > estimate(const Image &warp, const Landmarks5 &landmarks5) const noexcept=0
Checks whether persons face is occluded or not.
fsdk::IFaceOcclusionEstimator::validate
virtual Result< FSDKError > validate(Span< const Image > warps, Span< const Landmarks5 > landmarks, Span< Result< FSDKError > > errors) const noexcept=0
Validate input of multiple frames in a single function call.
fsdk::IRefCounted
Base strong reference counted object interface.
Definition IRefCounted.h:37
fsdk::Image
Image.
Definition Image.h:38
fsdk::Landmarks
Face landmarks template structure.
Definition Landmarks.h:23
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition Result.h:27
fsdk::ResultValue
Addon for Result to output some value aside the result. Specialization for copiable types.
Definition ResultValue.h:21