NVIDIA DeepStream SDK API Reference
6.4 Release
Gestures.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
3
*
4
* NVIDIA CORPORATION and its licensors retain all intellectual property
5
* and proprietary rights in and to this software, related documentation
6
* and any modifications thereto. Any use, reproduction, disclosure or
7
* distribution of this software and related documentation without an express
8
* license agreement from NVIDIA CORPORATION is strictly prohibited.
9
*/
10
11
#ifndef NV_GESTURES_H_
12
#define NV_GESTURES_H_
13
14
#include <memory>
15
16
#include <cuda_runtime.h>
17
18
#include <
cv/core/Array.h
>
19
#include <
cv/core/BBox.h
>
20
#include <
cv/core/Core.h
>
21
#include <
cv/core/Model.h
>
22
#include <
cv/core/Tensor.h
>
23
24
namespace
cvcore
{
namespace
gestures {
25
29
struct
GesturesPostProcessorParams
30
{
32
uint32_t
numGestures
;
34
size_t
gestureHistorySize
;
36
size_t
gestureHistoryThreshold
;
37
};
38
42
CVCORE_API
extern
const
ImagePreProcessingParams
defaultPreProcessorParams
;
43
47
CVCORE_API
extern
const
ModelInputParams
defaultModelInputParams
;
48
52
CVCORE_API
extern
const
ModelInferenceParams
defaultInferenceParams
;
53
57
CVCORE_API
extern
const
GesturesPostProcessorParams
defaultPostProcessorParams
;
58
59
/*
60
* Interface for running pre-processing on gestures model.
61
*/
62
class
CVCORE_API
GesturesPreProcessor
63
{
64
public
:
68
GesturesPreProcessor
() =
delete
;
69
75
GesturesPreProcessor
(
const
ImagePreProcessingParams
&preProcessorParams,
76
const
ModelInputParams
&modelInputParams);
77
81
~
GesturesPreProcessor
();
82
88
void
execute(
Tensor<NCHW, C3, F32>
&output,
const
Tensor<NHWC, C3, U8>
&input,
89
const
Array<BBox>
&inputBBoxes,
cudaStream_t
stream = 0);
90
91
private
:
95
struct
GesturesPreProcessorImpl;
96
std::unique_ptr<GesturesPreProcessorImpl> m_pImpl;
97
};
98
102
class
CVCORE_API
Gestures
103
{
104
public
:
108
static
constexpr
size_t
TOP_GESTURES = 10;
109
110
using
GesturesLikelihood
=
ArrayN<std::pair<uint32_t, float>
, TOP_GESTURES>;
111
116
Gestures
(
const
ImagePreProcessingParams
&imgparams,
const
ModelInputParams
&modelParams,
117
const
ModelInferenceParams
&modelInferParams,
118
const
GesturesPostProcessorParams
&postProcessParams);
119
123
Gestures
() =
delete
;
124
128
~
Gestures
();
129
138
void
execute(
Array<GesturesLikelihood>
&gestures,
const
Tensor<NHWC, C3, U8>
&input,
139
const
Array<BBox>
&inputBBox,
cudaStream_t
stream = 0);
140
141
private
:
142
struct
GesturesImpl;
143
std::unique_ptr<GesturesImpl> m_pImpl;
144
};
145
149
class
CVCORE_API
GesturesPostProcessor
150
{
151
public
:
152
GesturesPostProcessor
() =
delete
;
157
GesturesPostProcessor
(
const
ModelInputParams
&inputParams,
158
const
GesturesPostProcessorParams
&postProcessParams);
159
163
~
GesturesPostProcessor
();
164
168
void
allocateStagingBuffers();
169
178
void
execute(
Array<Gestures::GesturesLikelihood>
&gestures,
const
Tensor<CL, CX, F32>
&input,
179
cudaStream_t
stream = 0);
180
181
private
:
185
struct
GesturesPostProcessorImpl;
186
std::unique_ptr<GesturesPostProcessorImpl> m_pImpl;
187
};
188
189
}}
// namespace cvcore::gestures
190
#endif
cvcore::gestures::GesturesPostProcessorParams::numGestures
uint32_t numGestures
< Number of gestures
Definition:
Gestures.h:32
Model.h
cvcore::ModelInferenceParams
Struct to describe the model.
Definition:
Model.h:34
cvcore::gestures::GesturesPostProcessorParams
Describes the parameters for filtering the gesture detections.
Definition:
Gestures.h:29
cvcore
Definition:
PnP.h:20
cvcore::gestures::defaultModelInputParams
const CVCORE_API ModelInputParams defaultModelInputParams
Default parameters to describe the input expected for the model.
Array.h
cvcore::gestures::defaultPostProcessorParams
const CVCORE_API GesturesPostProcessorParams defaultPostProcessorParams
Default parameters for the post processing pipeline.
cvcore::gestures::GesturesPostProcessorParams::gestureHistorySize
size_t gestureHistorySize
Threshold for refining.
Definition:
Gestures.h:34
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition:
nvbufsurftransform.h:29
cvcore::Tensor
Definition:
Tensor.h:704
cvcore::gestures::defaultInferenceParams
const CVCORE_API ModelInferenceParams defaultInferenceParams
Default parameters to describe the model inference parameters.
cvcore::gestures::GesturesPostProcessor
Interface for running post-processing on gestures network.
Definition:
Gestures.h:149
cvcore::Array
Implementation of Array class.
Definition:
Array.h:133
cvcore::gestures::GesturesPreProcessor
Definition:
Gestures.h:62
cvcore::gestures::defaultPreProcessorParams
const CVCORE_API ImagePreProcessingParams defaultPreProcessorParams
Default parameters for the preprocessing pipeline.
cvcore::gestures::Gestures
Gestures parameters and implementation.
Definition:
Gestures.h:102
cvcore::ImagePreProcessingParams
Struct type for image preprocessing params.
Definition:
Image.h:67
CVCORE_API
#define CVCORE_API
Definition:
Core.h:24
Tensor.h
cvcore::ModelInputParams
Struct to describe input type required by the model.
Definition:
Model.h:23
BBox.h
cvcore::ArrayN
Implementation of ArrayN class.
Definition:
Array.h:258
Core.h
cvcore::gestures::GesturesPostProcessorParams::gestureHistoryThreshold
size_t gestureHistoryThreshold
Definition:
Gestures.h:36
Advance Information | Subject to Change | Generated by NVIDIA | Mon Dec 11 2023 17:51:24 | PR-09318-R32