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

IHumanFaceDetector.h
1 #pragma once
2
3 #include <fsdk/FSDKError.h>
4 #include <fsdk/IHumanFaceBatch.h>
5
6 #include <fsdk/IRefCounted.h>
7 #include <fsdk/Types/Detection.h>
8 #include <fsdk/Types/Image.h>
9 #include <fsdk/Types/Ref.h>
10 #include <fsdk/Types/ResultValue.h>
11 #include <fsdk/Types/Span.h>
12
13 #include <fsdk/vlc/future.h>
14
15 namespace fsdk {
16
17 #ifndef DOXYGEN_SHOULD_SKIP_THIS
18 DECLARE_SMARTPTR(IHumanFaceDetector);
19 #endif
20
29 enum class HumanFaceDetectionType {
30 HFDT_BBOX = 0,
31 HFDT_ASSOC = 1 << 0,
32 HFDT_ALL = 0xffff
33 };
34
38 struct IHumanFaceDetector : IRefCounted {
39
51 virtual ResultValue<FSDKError, IHumanFaceBatchPtr> detect(
52 Span<const Image> images,
53 Span<const Rect> rects,
54 HumanFaceDetectionType type = HumanFaceDetectionType::HFDT_ALL) const noexcept = 0;
55
67 virtual Result<FSDKError> validate(
68 Span<const Image> images,
69 Span<const Rect> rects,
70 Span<Result<FSDKError>> errors) const noexcept = 0;
71
75 using HumanFaceBatchFuture = vlc::future<IHumanFaceBatchPtr>;
76
91 virtual HumanFaceBatchFuture detectAsync(
92 Span<const Image> images,
93 Span<const Rect> rectangles,
94 HumanFaceDetectionType type = HumanFaceDetectionType::HFDT_ALL) const = 0;
95 };
96
97 /*
98 Implementation details.
99 */
100 inline HumanFaceDetectionType operator|(HumanFaceDetectionType a, HumanFaceDetectionType b) {
101 return static_cast<HumanFaceDetectionType>(static_cast<int>(a) | static_cast<int>(b));
102 }
103
104 /*
105 Implementation details.
106 */
107 inline bool operator&(HumanFaceDetectionType lhs, HumanFaceDetectionType rhs) {
108 return static_cast<int>(lhs) & static_cast<int>(rhs);
109 }
110
113 } // namespace fsdk
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:70
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:27
fsdk::HumanFaceDetectionType::HFDT_BBOX
Get bounding boxes of faces and humans.
fsdk::IHumanFaceDetector::validate
virtual Result< FSDKError > validate(Span< const Image > images, Span< const Rect > rects, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
FSDKError.h
Common SDK error codes.
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:37
fsdk::IHumanFaceDetector::detectAsync
virtual HumanFaceBatchFuture detectAsync(Span< const Image > images, Span< const Rect > rectangles, HumanFaceDetectionType type=HumanFaceDetectionType::HFDT_ALL) const =0
Asynchronously detect of faces and human bodies.
fsdk::ResultValue
Addon for Result to output some value aside the result. Specialization for copiable types...
Definition: ResultValue.h:21
fsdk::HumanFaceDetectionType
HumanFaceDetectionType
Detection type enumeration for IHumanFaceDetector.
Definition: IHumanFaceDetector.h:29
fsdk::HumanFaceDetectionType::HFDT_ASSOC
Get bounding boxes of faces and humans with associations.
fsdk::HumanFaceDetectionType::HFDT_ALL
Get all possible data.
fsdk::IHumanFaceDetector::HumanFaceBatchFuture
vlc::future< IHumanFaceBatchPtr > HumanFaceBatchFuture
Common aliases for IDetector asynchronous interface.
Definition: IHumanFaceDetector.h:75
fsdk::IHumanFaceDetector
Human and face detector interface.
Definition: IHumanFaceDetector.h:38
fsdk::IHumanFaceDetector::detect
virtual ResultValue< FSDKError, IHumanFaceBatchPtr > detect(Span< const Image > images, Span< const Rect > rects, HumanFaceDetectionType type=HumanFaceDetectionType::HFDT_ALL) const noexcept=0
Batched detect of faces and human bodies.
fsdk::Span
Span. Not owning data view. It incapsulated pointer to the continuous array with one or more T objec...
Definition: Span.h:14
IRefCounted.h
Reference counted object interface.