Face Engine SDK  5.23.1
A face detection, recognition and tracking engine.
include/fsdk/Estimators/IFaceOcclusionEstimator.h
00001 #pragma once
00002 
00003 #include <fsdk/IObject.h>
00004 #include <fsdk/FSDKError.h>
00005 #include <fsdk/Optional.h>
00006 #include <fsdk/Types.h>
00007 
00008 namespace fsdk {
00009 
00010 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00011     DECLARE_SMARTPTR(IFaceOcclusionEstimator);
00012 #endif
00013 
00023     enum class FaceOcclusionType : uint8_t {
00024         Forehead = 0, 
00025         LeftEye,      
00026         RightEye,     
00027         Nose,         
00028         Mouth,        
00029         LowerFace,    
00030         Count         
00031     };
00032 
00037     enum class FaceOcclusionState : uint8_t {
00038         NotOccluded = 0, 
00039         Occluded,        
00040         Count            
00041     };
00042 
00050     struct FaceOcclusionEstimation {
00051         FaceOcclusionState states[static_cast<uint8_t>(FaceOcclusionType::Count)]; 
00052 
00054         float typeScores[static_cast<uint8_t>(FaceOcclusionType::Count)];
00055 
00061         inline float getScore(FaceOcclusionType type) const {
00062             return typeScores[static_cast<uint8_t>(type)];
00063         }
00064 
00070         inline FaceOcclusionState getState(FaceOcclusionType type) const {
00071             return states[static_cast<uint8_t>(type)];
00072         }
00073 
00074         FaceOcclusionState overallOcclusionState;
00075         float overallOcclusionScore;
00076         float hairOcclusionScore;
00077     };
00078 
00083     struct IFaceOcclusionEstimator : IRefCounted {
00092         virtual ResultValue<FSDKError, FaceOcclusionEstimation>
00093         estimate(const Image& warp, const Landmarks5& landmarks5) const noexcept = 0;
00094 
00107         virtual Result<FSDKError> estimate(
00108             Span<const Image> warps,
00109             Span<const Landmarks5> landmarks,
00110             Span<FaceOcclusionEstimation> faceOcclusionEstimations) const noexcept = 0;
00111 
00123         virtual Result<FSDKError> validate(
00124             Span<const Image> warps,
00125             Span<const Landmarks5> landmarks,
00126             Span<Result<FSDKError>> errors) const noexcept = 0;
00127     };
00128 
00130 } // namespace fsdk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines