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

ICrowdEstimator.h
1 #pragma once
2
3 #include <fsdk/Def.h>
4 #include <fsdk/FSDKError.h>
5 #include <fsdk/IRefCounted.h>
6 #include <fsdk/Types/Image.h>
7 #include <fsdk/Types/Ref.h>
8 #include <fsdk/Types/Result.h>
9 #include <fsdk/Types/ResultValue.h>
10 #include <fsdk/Types/Span.h>
11 #include <fsdk/IPointBatch.h>
12
13 namespace fsdk {
14
15 #ifndef DOXYGEN_SHOULD_SKIP_THIS
16 DECLARE_SMARTPTR(ICrowdEstimator);
17 #endif
18
27 enum CrowdEstimatorType {
28 CET_DEFAULT = 0,
29 CET_SINGLE_NET = 1,
30 CET_TWO_NETS = 2,
31 CET_COUNT
32 };
33
38 struct CrowdEstimation {
39 size_t count;
40 IPointBatchPtr points;
41 };
42
49 struct ICrowdEstimator : IRefCounted {
54 enum EstimationRequest {
55 estimateHeadCount = 0,
56 estimateHeadCountAndCoords = 1 << 0,
57 };
58
69 virtual Result<FSDKError> estimate(
70 const Image& image,
71 const Rect& rect,
72 CrowdEstimation& estimation,
73 EstimationRequest request = EstimationRequest::estimateHeadCount) const noexcept = 0;
74
88 virtual Result<FSDKError> estimate(
89 Span<const Image> images,
90 Span<const Rect> rects,
91 Span<CrowdEstimation> estimations,
92 EstimationRequest request = EstimationRequest::estimateHeadCount) const noexcept = 0;
93
106 virtual Result<FSDKError> validate(
107 Span<const Image> images,
108 Span<const Rect> rects,
109 Span<Result<FSDKError>> errors,
110 EstimationRequest request = EstimationRequest::estimateHeadCount) const noexcept = 0;
111
117 virtual CrowdEstimatorType getType() const noexcept = 0;
118 };
119
120 inline ICrowdEstimator::EstimationRequest
121 operator|(ICrowdEstimator::EstimationRequest a, ICrowdEstimator::EstimationRequest b) {
122 return static_cast<ICrowdEstimator::EstimationRequest>(static_cast<int>(a) | static_cast<int>(b));
123 }
124
126 } // 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::ICrowdEstimator::getType
virtual CrowdEstimatorType getType() const noexcept=0
Returns a type of the estimator.
fsdk::ICrowdEstimator::estimateHeadCount
Get number of peoples (heads)
Definition: ICrowdEstimator.h:55
fsdk::CrowdEstimation
Crowd estimation structure.
Definition: ICrowdEstimator.h:38
fsdk::CrowdEstimation::count
size_t count
The number of peoples (heads) on the image.
Definition: ICrowdEstimator.h:39
FSDKError.h
Common SDK error codes.
fsdk::ICrowdEstimator::estimate
virtual Result< FSDKError > estimate(const Image &image, const Rect &rect, CrowdEstimation &estimation, EstimationRequest request=EstimationRequest::estimateHeadCount) const noexcept=0
Estimates the crowd on the target image.
fsdk::CET_SINGLE_NET
Single network mode - only Crowd estimation will be used.
Definition: ICrowdEstimator.h:29
fsdk::IRefCounted
Base strong reference counted object interface.
Definition: IRefCounted.h:37
fsdk::CET_DEFAULT
Default type which is specified in config file.
Definition: ICrowdEstimator.h:28
Def.h
Common SDK definitions.
fsdk::CET_TWO_NETS
Double network mode - Crowd + HumanDetector (by default) or Crowd + HeadDetector. ...
Definition: ICrowdEstimator.h:30
fsdk::ICrowdEstimator
Crowd estimator interface.
Definition: ICrowdEstimator.h:49
fsdk::Image
Image.
Definition: Image.h:38
fsdk::ICrowdEstimator::EstimationRequest
EstimationRequest
EstimationRequest lists all possible estimation types that ICrowdEstimator can estimate.
Definition: ICrowdEstimator.h:54
fsdk::ICrowdEstimator::estimateHeadCountAndCoords
Get number of people (heads) and head coordinates.
Definition: ICrowdEstimator.h:56
fsdk::BaseRect< int >
fsdk::ICrowdEstimator::validate
virtual Result< FSDKError > validate(Span< const Image > images, Span< const Rect > rects, Span< Result< FSDKError >> errors, EstimationRequest request=EstimationRequest::estimateHeadCount) const noexcept=0
Validate input of multiple frames in a single function call.
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::CrowdEstimation::points
IPointBatchPtr points
Coordinates of people heads. Empty if not requested.
Definition: ICrowdEstimator.h:40
IRefCounted.h
Reference counted object interface.
fsdk::CrowdEstimatorType
CrowdEstimatorType
CrowdEstimator type enumeration.
Definition: ICrowdEstimator.h:27