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

IHumanDetector.h
1 #pragma once
2
3 #include "FSDKError.h"
4 #include "IHumanDetectionBatch.h"
5 #include "IObject.h"
6 #include "Types/Human.h"
7
8 namespace fsdk {
9
10 #ifndef DOXYGEN_SHOULD_SKIP_THIS
11 DECLARE_SMARTPTR(IHumanDetector);
12 #endif
13
23 enum HumanDetectionType {
24 HDT_BOX = 0,
25 HDT_POINTS = 1<<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 {
49 virtual ResultValue<FSDKError, Ref<IHumanDetectionBatch>>
50 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(
67 const Image& image,
68 const Rect& rect,
69 HumanDetectionType type = HDT_BOX) const noexcept = 0;
70
80 virtual ResultValue<FSDKError, Human>
81 redetectOne(
82 const Image& image,
83 const Detection& detection,
84 HumanDetectionType type = HDT_BOX) const noexcept = 0;
85
102 virtual ResultValue<FSDKError, IHumanDetectionBatchPtr>
103 redetect(
104 Span<const Image> images,
105 Ref<IHumanDetectionBatch> detectionBatch,
106 HumanDetectionType type = HDT_BOX) const noexcept = 0;
107
123 virtual ResultValue<FSDKError, IHumanDetectionBatchPtr>
124 redetect(
125 Span<const Image> images,
126 Span<Span<const Detection>> detections,
127 HumanDetectionType type = HDT_BOX) const noexcept = 0;
128
141 virtual Result<FSDKError>
142 validate(
143 Span<const Image> images,
144 Span<const Rect> rects,
145 uint32_t detectionPerImageNum,
146 Span<Result<FSDKError>> errors) const noexcept = 0;
147
160 virtual Result<FSDKError> validate(
161 Span<const Image> images,
162 Ref<IHumanDetectionBatch> detectionBatch,
163 Span<Result<FSDKError>> errors) const noexcept = 0;
164
178 virtual Result<FSDKError>
179 validate(
180 Span<const Image> images,
181 Span<Span<const Detection>> detections,
182 Span<Span<Result<FSDKError>>> errors) const noexcept = 0;
183
184 };
185
188 }
fsdk::Span
Span. @detail Not owning data view. It incapsulated pointer to the continuous array with one or more ...
Definition: Span.h:15
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.
DECLARE_SMARTPTR
#define DECLARE_SMARTPTR(X)
Smart ptr declaration helper macro.
Definition: Def.h:59
IObject.h
Object system types and interfaces.
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::BaseRect< int >
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::IHumanDetector::validate
virtual Result< FSDKError > validate(Span< const Image > images, Ref< IHumanDetectionBatch > detectionBatch, Span< Result< FSDKError >> errors) const noexcept=0
Validate input of multiple frames in a single function call.
fsdk::IHumanDetector
human body detector interface.
Definition: IHumanDetector.h:36
fsdk::IHumanDetector::detect
virtual ResultValue< FSDKError, Ref< IHumanDetectionBatch > > 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_ALL
@ HDT_ALL
Get all supported parameters.
Definition: IHumanDetector.h:26
fsdk::HDT_BOX
@ HDT_BOX
Get bounding boxes of human bodies.
Definition: IHumanDetector.h:24
fsdk::HDT_POINTS
@ HDT_POINTS
Get 17 keypoints of human, with score for each one.
Definition: IHumanDetector.h:25
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::Detection
Detection structure. @detail Stores a detected bounding box within a source image rect.
Definition: Detection.h:10
fsdk::IHumanDetector::redetect
virtual ResultValue< FSDKError, IHumanDetectionBatchPtr > redetect(Span< const Image > images, Span< Span< const Detection >> detections, HumanDetectionType type=HDT_BOX) const noexcept=0
Batched redetect humans on multiple images based on the detection results for the previous frames.
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:30
FSDKError.h
Common SDK error codes.
fsdk::Image
Image.
Definition: Image.h:38
fsdk::Ref
Smart pointer for reference counted objects.
Definition: Ref.h:22
fsdk::IHumanDetector::validate
virtual Result< FSDKError > validate(Span< const Image > images, Span< Span< const Detection >> detections, Span< Span< Result< FSDKError >>> errors) const noexcept=0
Validate input of multiple frames in a single function call.
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::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:36
fsdk::HumanDetectionType
HumanDetectionType
Human detection type enumeration.
Definition: IHumanDetector.h:23
fsdk::ResultValue
Addon for Result to output some value aside the result. Specialization for copiable types.
Definition: ResultValue.h:25