NVIDIA DeepStream SDK API Reference

7.0 Release
nvdsinfer.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2017-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
29 #ifndef _NVDSINFER_H_
30 #define _NVDSINFER_H_
31 
32 #include <stdint.h>
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #define NVDSINFER_MAX_DIMS 8
40 
41 #define _DS_DEPRECATED_(STR) __attribute__ ((deprecated (STR)))
42 
46 typedef struct
47 {
49  unsigned int numDims;
51  unsigned int d[NVDSINFER_MAX_DIMS];
53  unsigned int numElements;
55 
59 typedef struct
60 {
62  unsigned int c;
64  unsigned int h;
66  unsigned int w;
68 
72 typedef enum
73 {
75  FLOAT = 0,
77  HALF = 1,
79  INT8 = 2,
81  INT32 = 3
83 
87 typedef struct
88 {
92  union {
94  NvDsInferDims dims _DS_DEPRECATED_("dims is deprecated. Use inferDims instead");
95  };
99  const char* layerName;
101  void *buffer;
104  int isInput;
106 
110 typedef struct
111 {
113  unsigned int width;
115  unsigned int height;
117  unsigned int channels;
119 
124 #define getDimsCHWFromDims(dimsCHW,dims) \
125  do { \
126  (dimsCHW).c = (dims).d[0]; \
127  (dimsCHW).h = (dims).d[1]; \
128  (dimsCHW).w = (dims).d[2]; \
129  } while (0)
130 
131 #define getDimsHWCFromDims(dimsCHW,dims) \
132  do { \
133  (dimsCHW).h = (dims).d[0]; \
134  (dimsCHW).w = (dims).d[1]; \
135  (dimsCHW).c = (dims).d[2]; \
136  } while (0)
137 
141 typedef struct
142 {
144  unsigned int classId;
145 
147  float left;
149  float top;
151  float width;
153  float height;
154 
159 
164 
168 typedef struct
169 {
171  unsigned int classId;
172 
174  float left;
176  float top;
178  float width;
180  float height;
181 
185 
187  float *mask;
189  unsigned int mask_width;
191  unsigned int mask_height;
193  unsigned int mask_size;
195 
199 typedef struct
200 {
204  unsigned int attributeIndex;
206  unsigned int attributeValue;
214 
218 typedef enum {
245 
249 typedef enum {
255 
263 const char* NvDsInferStatus2Str(NvDsInferStatus status);
264 
265 #ifdef __cplusplus
266 }
267 #endif
268 
269 /* C++ data types */
270 #ifdef __cplusplus
271 
276 typedef enum
277 {
278  kSELECTOR_MIN = 0,
279  kSELECTOR_OPT,
280  kSELECTOR_MAX,
281  kSELECTOR_SIZE
282 } NvDsInferProfileSelector;
283 
287 typedef struct
288 {
289  int batchSize = 0;
290  NvDsInferDims dims = {0};
291 } NvDsInferBatchDims;
292 
297 struct NvDsInferBatchDimsLayerInfo : NvDsInferLayerInfo
298 {
299  NvDsInferBatchDims profileDims[kSELECTOR_SIZE];
300 };
301 
302 #endif
303 
304 #endif
305 
NvDsInferAttribute::attributeLabel
char * attributeLabel
Holds a pointer to a string containing the attribute's label.
Definition: nvdsinfer.h:212
NvDsInferDimsCHW::w
unsigned int w
Holds the width of the layer.
Definition: nvdsinfer.h:66
NvDsInferInstanceMaskInfo::left
float left
Holds the horizontal offset of the bounding box shape for the object.
Definition: nvdsinfer.h:174
NvDsInferInstanceMaskInfo::width
float width
Holds the width of the object's bounding box.
Definition: nvdsinfer.h:178
NvDsInferAttribute::attributeIndex
unsigned int attributeIndex
Holds the index of the attribute's label.
Definition: nvdsinfer.h:204
NvDsInferInstanceMaskInfo::classId
unsigned int classId
Holds the ID of the class to which the object belongs.
Definition: nvdsinfer.h:171
NvDsInferObjectDetectionInfo::width
float width
Holds the width of the object's bounding box.
Definition: nvdsinfer.h:151
NvDsInferDims::numElements
unsigned int numElements
Holds the number of elements in the layer, including all dimensions.
Definition: nvdsinfer.h:53
NvDsInferObjectDetectionInfo::left
float left
Holds the horizontal offset of the bounding box shape for the object.
Definition: nvdsinfer.h:147
NVDSINFER_TRTIS_ERROR
@ NVDSINFER_TRTIS_ERROR
[deprecated]TRT-IS error was encountered
Definition: nvdsinfer.h:239
NVDSINFER_LOG_ERROR
@ NVDSINFER_LOG_ERROR
Definition: nvdsinfer.h:250
NvDsInferDims
Holds the dimensions of a layer.
Definition: nvdsinfer.h:46
NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: nvdsinfer.h:220
NvDsInferDimsCHW::h
unsigned int h
Holds the height of the layer.
Definition: nvdsinfer.h:64
NvDsInferLogLevel
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
Definition: nvdsinfer.h:249
NvDsInferLayerInfo::bindingIndex
int bindingIndex
Holds the TensorRT binding index of the layer.
Definition: nvdsinfer.h:97
NVDSINFER_TENSORRT_ERROR
@ NVDSINFER_TENSORRT_ERROR
TensorRT interface failed.
Definition: nvdsinfer.h:233
NVDSINFER_LOG_INFO
@ NVDSINFER_LOG_INFO
Definition: nvdsinfer.h:252
NvDsInferDataType
NvDsInferDataType
Specifies the data type of a layer.
Definition: nvdsinfer.h:72
NvDsInferInstanceMaskInfo
Holds information about one parsed object and instance mask from a detector's output.
Definition: nvdsinfer.h:168
NvDsInferInstanceMaskInfo::detectionConfidence
float detectionConfidence
Holds the object detection confidence level; must in the range [0.0,1.0].
Definition: nvdsinfer.h:184
NvDsInferStatus2Str
const char * NvDsInferStatus2Str(NvDsInferStatus status)
Get the string name for the status.
NvDsInferInstanceMaskInfo::mask_size
unsigned int mask_size
Holds size of mask in bytes.
Definition: nvdsinfer.h:193
NVDSINFER_UNKNOWN_ERROR
@ NVDSINFER_UNKNOWN_ERROR
Unknown error was encountered.
Definition: nvdsinfer.h:243
NvDsInferObjectDetectionInfo::classId
unsigned int classId
Holds the ID of the class to which the object belongs.
Definition: nvdsinfer.h:144
NvDsInferNetworkInfo::height
unsigned int height
Holds the input height for the model.
Definition: nvdsinfer.h:115
NVDSINFER_TRITON_ERROR
@ NVDSINFER_TRITON_ERROR
Triton error was encountered.
Definition: nvdsinfer.h:237
NvDsInferObjectDetectionInfo
Holds information about one parsed object from a detector's output.
Definition: nvdsinfer.h:141
FLOAT
@ FLOAT
Specifies FP32 format.
Definition: nvdsinfer.h:75
NVDSINFER_LOG_WARNING
@ NVDSINFER_LOG_WARNING
Definition: nvdsinfer.h:251
NVDSINFER_OUTPUT_PARSING_FAILED
@ NVDSINFER_OUTPUT_PARSING_FAILED
Output parsing failed.
Definition: nvdsinfer.h:229
NVDSINFER_MAX_DIMS
#define NVDSINFER_MAX_DIMS
Definition: nvdsinfer.h:39
NvDsInferNetworkInfo
Holds information about the model network.
Definition: nvdsinfer.h:110
NvDsInferLayerInfo
Holds information about one layer in the model.
Definition: nvdsinfer.h:87
NvDsInferNetworkInfo::channels
unsigned int channels
Holds the number of input channels for the model.
Definition: nvdsinfer.h:117
HALF
@ HALF
Specifies FP16 format.
Definition: nvdsinfer.h:77
INT32
@ INT32
Specifies INT32 format.
Definition: nvdsinfer.h:81
NvDsInferLayerInfo::buffer
void * buffer
Holds a pointer to the buffer for the layer data.
Definition: nvdsinfer.h:101
NvDsInferInstanceMaskInfo::mask_height
unsigned int mask_height
Holds height of mask.
Definition: nvdsinfer.h:191
NvDsInferObjectDetectionInfo::top
float top
Holds the vertical offset of the object's bounding box.
Definition: nvdsinfer.h:149
NvDsInferLayerInfo::inferDims
NvDsInferDims inferDims
Definition: nvdsinfer.h:93
NvDsInferInstanceMaskInfo::top
float top
Holds the vertical offset of the object's bounding box.
Definition: nvdsinfer.h:176
INT8
@ INT8
Specifies INT8 format.
Definition: nvdsinfer.h:79
NvDsInferInstanceMaskInfo::mask
float * mask
Holds object segment mask.
Definition: nvdsinfer.h:187
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: nvdsinfer.h:231
NvDsInferLayerInfo::dataType
NvDsInferDataType dataType
Holds the data type of the layer.
Definition: nvdsinfer.h:90
NvDsInferParseObjectInfo
NvDsInferObjectDetectionInfo NvDsInferParseObjectInfo
A typedef defined to maintain backward compatibility.
Definition: nvdsinfer.h:163
NvDsInferNetworkInfo::width
unsigned int width
Holds the input width for the model.
Definition: nvdsinfer.h:113
NVDSINFER_CONFIG_FAILED
@ NVDSINFER_CONFIG_FAILED
Failed to configure the NvDsInferContext instance possibly due to an erroneous initialization propert...
Definition: nvdsinfer.h:223
NvDsInferInstanceMaskInfo::height
float height
Holds the height of the object's bounding box.
Definition: nvdsinfer.h:180
NvDsInferDimsCHW
Holds the dimensions of a three-dimensional layer.
Definition: nvdsinfer.h:59
NvDsInferLayerInfo::isInput
int isInput
Holds a Boolean; true if the layer is an input layer, or false if an output layer.
Definition: nvdsinfer.h:104
NvDsInferDims::numDims
unsigned int numDims
Holds the number of dimesions in the layer.
Definition: nvdsinfer.h:49
NVDSINFER_INVALID_PARAMS
@ NVDSINFER_INVALID_PARAMS
Invalid parameters were supplied.
Definition: nvdsinfer.h:227
NvDsInferAttribute::attributeConfidence
float attributeConfidence
Holds the attribute's confidence level.
Definition: nvdsinfer.h:208
NvDsInferLayerInfo::layerName
const char * layerName
Holds the name of the layer.
Definition: nvdsinfer.h:99
NvDsInferObjectDetectionInfo::height
float height
Holds the height of the object's bounding box.
Definition: nvdsinfer.h:153
NvDsInferAttribute::attributeValue
unsigned int attributeValue
Holds the the attribute's output value.
Definition: nvdsinfer.h:206
NVDSINFER_LOG_DEBUG
@ NVDSINFER_LOG_DEBUG
Definition: nvdsinfer.h:253
_DS_DEPRECATED_
#define _DS_DEPRECATED_(STR)
Definition: nvdsinfer.h:41
NvDsInferInstanceMaskInfo::mask_width
unsigned int mask_width
Holds width of mask.
Definition: nvdsinfer.h:189
NvDsInferAttribute
Holds information about one classified attribute.
Definition: nvdsinfer.h:199
NVDSINFER_RESOURCE_ERROR
@ NVDSINFER_RESOURCE_ERROR
Resource error was encountered.
Definition: nvdsinfer.h:235
NVDSINFER_CUSTOM_LIB_FAILED
@ NVDSINFER_CUSTOM_LIB_FAILED
Custom Library interface implementation failed.
Definition: nvdsinfer.h:225
NvDsInferObjectDetectionInfo::detectionConfidence
float detectionConfidence
Holds the object detection confidence level; must in the range [0.0,1.0].
Definition: nvdsinfer.h:157
NVDSINFER_MEM_ERROR
@ NVDSINFER_MEM_ERROR
Cuda Memory error was encountered.
Definition: nvdsinfer.h:241
NvDsInferDimsCHW::c
unsigned int c
Holds the channel count of the layer.
Definition: nvdsinfer.h:62
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: nvdsinfer.h:218