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

IHumanDetector.h
1 #pragma once
2
3 #include <fsdk/FSDKError.h>
4 #include <fsdk/IHumanDetectionBatch.h>
5 #include <fsdk/IObject.h>
6 #include <fsdk/Types/Human.h>
7
8 #include <fsdk/vlc/future.h>
9
10 namespace fsdk {
11
12 #ifndef DOXYGEN_SHOULD_SKIP_THIS
13 DECLARE_SMARTPTR(IHumanDetector);
14 #endif
15
24 enum HumanDetectionType {
25 HDT_BOX = 0,
26 HDT_ALL = 0xffff
27 };
28
29 inline HumanDetectionType operator|(HumanDetectionType a, HumanDetectionType b) {
30 return static_cast<HumanDetectionType>(static_cast<int>(a) | static_cast<int>(b));
31 }
32
36 struct IHumanDetector : IRefCounted {
50 virtual ResultValue<FSDKError, IHumanDetectionBatchPtr> detect(
51 Span<const Image> images,
52 Span<const Rect> rects,
53 uint32_t detectionPerImageNum,
54 HumanDetectionType type = HDT_BOX) const noexcept = 0;
55
65 virtual ResultValue<FSDKError, Human>
66 detectOne(const Image& image, const Rect& rect, HumanDetectionType type = HDT_BOX) const noexcept = 0;
67
78 virtual ResultValue<FSDKError, Human> redetectOne(
79 const Image& image,
80 const Detection& detection,
81 HumanDetectionType type = HDT_BOX) const noexcept = 0;
82
99 virtual ResultValue<FSDKError, IHumanDetectionBatchPtr> redetect(
100 Span<const Image> images,
101 Ref<IHumanDetectionBatch> detectionBatch,
102 HumanDetectionType type = HDT_BOX) const noexcept = 0;
103
121 virtual ResultValue<FSDKError, IHumanDetectionBatchPtr> redetect(
122 Span<const Image> images,
123 Span<Span<const Detection>> detections,
124 HumanDetectionType type = HDT_BOX) const noexcept = 0;
125
138 virtual Result<FSDKError> validate(
139 Span<const Image> images,
140 Span<const Rect> rects,
141 uint32_t detectionPerImageNum,
142 Span<Result<FSDKError>> errors) const noexcept = 0;
143
156 virtual Result<FSDKError> validate(
157 Span<const Image> images,
158 Ref<IHumanDetectionBatch> detectionBatch,
159 Span<Result<FSDKError>> errors) const noexcept = 0;
160
175 virtual Result<FSDKError> validate(
176 Span<const Image> images,
177 Span<Span<const Detection>> detections,
178 Span<Span<Result<FSDKError>>> errors) const noexcept = 0;
179
183 using HumanBatchFuture = vlc::future<IHumanDetectionBatchPtr>;
184
200 virtual HumanBatchFuture detectAsync(
201 Span<const Image> images,
202 Span<const Rect> rectangles,
203 uint32_t detectionPerImageNum,
204 HumanDetectionType type = HDT_BOX) const = 0;
205
222 virtual HumanBatchFuture redetectAsync(
223 Span<const Image> images,
224 Ref<IHumanDetectionBatch> detectionBatch,
225 HumanDetectionType type = HDT_BOX) const = 0;
226
244 virtual HumanBatchFuture redetectAsync(
245 Span<const Image> images,
246 Span<Span<const Detection>> detections,
247 HumanDetectionType type = HDT_BOX) const = 0;
248 };
249
252 } // namespace fsdk
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:56
fsdk::HDT_ALL
Get all supported parameters.
Definition: IHumanDetector.h:26
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:27
fsdk::IHumanDetector::validate
virtual Result< FSDKError > validate(Span< const Image > images, Span< const Rect > rects, uint32_t detectionPerImageNum, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
fsdk::IHumanDetector::redetectAsync
virtual HumanBatchFuture redetectAsync(Span< const Image > images, Ref< IHumanDetectionBatch > detectionBatch, HumanDetectionType type=HDT_BOX) const =0
Asynchronously redetects human bodies on multiple images based on the detection results for the previ...
fsdk::IHumanDetector::detectAsync
virtual HumanBatchFuture detectAsync(Span< const Image > images, Span< const Rect > rectangles, uint32_t detectionPerImageNum, HumanDetectionType type=HDT_BOX) const =0
Asynchronously detects human bodies on multiple images.
fsdk::IHumanDetector::HumanBatchFuture
vlc::future< IHumanDetectionBatchPtr > HumanBatchFuture
Common alias for IHumanDetector asynchronous interface.
Definition: IHumanDetector.h:183
fsdk::Ref
Smart pointer for reference counted objects.
Definition: Ref.h:27
IObject.h
Object system types and interfaces.
FSDKError.h
Common SDK error codes.
fsdk::IHumanDetector::redetect
virtual ResultValue< FSDKError, IHumanDetectionBatchPtr > redetect(Span< const Image > images, Ref< IHumanDetectionBatch > detectionBatch, HumanDetectionType type=HDT_BOX) const noexcept=0
Batched redetect humans on multiple images based on the detection results for the previous frames...
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:37
fsdk::IHumanDetector
human body detector interface.
Definition: IHumanDetector.h:36
fsdk::IHumanDetector::detect
virtual ResultValue< FSDKError, IHumanDetectionBatchPtr > detect(Span< const Image > images, Span< const Rect > rects, uint32_t detectionPerImageNum, HumanDetectionType type=HDT_BOX) const noexcept=0
Batched detect of human bodies.
fsdk::HDT_BOX
Get bounding boxes of human bodies.
Definition: IHumanDetector.h:25
fsdk::IHumanDetector::redetectOne
virtual ResultValue< FSDKError, Human > redetectOne(const Image &image, const Detection &detection, HumanDetectionType type=HDT_BOX) const noexcept=0
redetect one person from input image.
fsdk::ResultValue
Addon for Result to output some value aside the result. Specialization for copiable types...
Definition: ResultValue.h:21
fsdk::Image
Image.
Definition: Image.h:38
fsdk::BaseRect< int >
fsdk::HumanDetectionType
HumanDetectionType
Human detection type enumeration.
Definition: IHumanDetector.h:24
fsdk::IHumanDetector::detectOne
virtual ResultValue< FSDKError, Human > detectOne(const Image &image, const Rect &rect, HumanDetectionType type=HDT_BOX) const noexcept=0
Detect one person on input image.
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