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

IBestShotQualityEstimator.h
1 #pragma once
2 #include <fsdk/Estimators/IHeadPoseEstimator.h>
3
4 #include <fsdk/IObject.h>
5 #include <fsdk/FSDKError.h>
6 #include <fsdk/Optional.h>
7 #include <fsdk/Types.h>
8 #include <fsdk/vlc/future.h>
9 #include <vector>
10
11 namespace fsdk {
12
13 #ifndef DOXYGEN_SHOULD_SKIP_THIS
14 DECLARE_SMARTPTR(IBestShotQualityEstimator);
15 #endif
16
27 struct IBestShotQualityEstimator : IRefCounted {
32 enum EstimationRequest {
33 estimateAGS = 1 << 0,
34 estimateHeadPose = 1 << 1,
35 estimateAll = 0xffff
36 };
37
41 struct EstimationResult {
42 Optional<HeadPoseEstimation> headPose;
43 Optional<float> ags;
44 };
45
57 virtual Result<FSDKError> estimate(
58 const Image& image,
59 const Detection& detection,
60 const EstimationRequest request,
61 EstimationResult& result) const noexcept = 0;
62
77 virtual Result<FSDKError> estimate(
78 Span<const Image> images,
79 Span<const Detection> detections,
80 const EstimationRequest request,
81 Span<EstimationResult> results) const noexcept = 0;
82
86 using EstimationBatch = std::vector<EstimationResult>;
87 using EstimationBatchFuture = vlc::future<EstimationBatch>;
103 virtual EstimationBatchFuture estimateAsync(
104 Span<const Image> images,
105 Span<const Detection> detections,
106 const EstimationRequest request) const = 0;
107
121 virtual Result<FSDKError> validate(
122 Span<const Image> images,
123 Span<const Detection> detections,
124 const EstimationRequest request,
125 Span<Result<FSDKError>> errors) const noexcept = 0;
126 };
127
128 /*
129 Implementation details.
130 */
131 inline IBestShotQualityEstimator::EstimationRequest operator|(
132 IBestShotQualityEstimator::EstimationRequest first,
133 IBestShotQualityEstimator::EstimationRequest second) {
134 return static_cast<IBestShotQualityEstimator::EstimationRequest>(
135 static_cast<int>(first) | static_cast<int>(second));
136 }
137
139 } // namespace fsdk
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:56
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:27
Types.h
Common data types and structures.
fsdk::IBestShotQualityEstimator::validate
virtual Result< FSDKError > validate(Span< const Image > images, Span< const Detection > detections, const EstimationRequest request, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
fsdk::IBestShotQualityEstimator
BestShotQuality estimator interface.
Definition: IBestShotQualityEstimator.h:27
fsdk::IBestShotQualityEstimator::EstimationRequest
EstimationRequest
EstimationRequest lists all possible estimation attributes that BestShotQuality estimator is able to ...
Definition: IBestShotQualityEstimator.h:32
IObject.h
Object system types and interfaces.
fsdk::IBestShotQualityEstimator::EstimationResult
BestShotQualityEstimator output structure.
Definition: IBestShotQualityEstimator.h:41
fsdk::IBestShotQualityEstimator::estimateAsync
virtual EstimationBatchFuture estimateAsync(Span< const Image > images, Span< const Detection > detections, const EstimationRequest request) const =0
Asynchronously estimate unified AGS and HeadPose attributes of multiple frames in a single estimate f...
FSDKError.h
Common SDK error codes.
fsdk::IBestShotQualityEstimator::estimate
virtual Result< FSDKError > estimate(const Image &image, const Detection &detection, const EstimationRequest request, EstimationResult &result) const noexcept=0
Estimate unified AGS and HeadPose attributes.
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:37
fsdk::IBestShotQualityEstimator::estimateAll
Make full estimation (all attributes)
Definition: IBestShotQualityEstimator.h:35
fsdk::IBestShotQualityEstimator::estimateHeadPose
Estimate HeadPose.
Definition: IBestShotQualityEstimator.h:34
fsdk::Image
Image.
Definition: Image.h:38
fsdk::IBestShotQualityEstimator::EstimationResult::ags
Optional< float > ags
AGS estimation if was requested, empty otherwise.
Definition: IBestShotQualityEstimator.h:43
fsdk::Detection
Detection structure. Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
fsdk::Span
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14
fsdk::IBestShotQualityEstimator::estimateAGS
Estimate AGS.
Definition: IBestShotQualityEstimator.h:33
fsdk::IBestShotQualityEstimator::EstimationBatch
std::vector< EstimationResult > EstimationBatch
Common aliases for BestShotQuality asynchronous interface.
Definition: IBestShotQualityEstimator.h:86
fsdk::IBestShotQualityEstimator::EstimationResult::headPose
Optional< HeadPoseEstimation > headPose
HeadPose estimation if was requested, empty otherwise.
Definition: IBestShotQualityEstimator.h:42