NVIDIA DeepStream SDK API Reference

8.0 Release
9.0/sources/includes/nvdsinfer.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2017-2026 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  INT64 = 4,
85  UINT8 = 5
87 
91 typedef struct
92 {
94  NvDsInferDataType dataType;
96  union {
97  NvDsInferDims inferDims;
98  NvDsInferDims dims _DS_DEPRECATED_("dims is deprecated. Use inferDims instead");
99  };
101  int bindingIndex;
103  const char* layerName;
105  void *buffer;
108  int isInput;
110 
114 typedef struct
115 {
117  unsigned int width;
119  unsigned int height;
121  unsigned int channels;
123 
128 #define getDimsCHWFromDims(dimsCHW,dims) \
129  do { \
130  (dimsCHW).c = (dims).d[0]; \
131  (dimsCHW).h = (dims).d[1]; \
132  (dimsCHW).w = (dims).d[2]; \
133  } while (0)
134 
135 #define getDimsHWCFromDims(dimsCHW,dims) \
136  do { \
137  (dimsCHW).h = (dims).d[0]; \
138  (dimsCHW).w = (dims).d[1]; \
139  (dimsCHW).c = (dims).d[2]; \
140  } while (0)
141 
145 typedef struct
146 {
148  unsigned int classId;
149 
151  float left;
153  float top;
155  float width;
157  float height;
158 
161  float detectionConfidence;
162 
165  float rotation_angle;
167 
172 
176 typedef struct
177 {
179  unsigned int classId;
180 
182  float left;
184  float top;
186  float width;
188  float height;
189 
192  float detectionConfidence;
193 
195  float *mask;
197  unsigned int mask_width;
199  unsigned int mask_height;
201  unsigned int mask_size;
203 
207 typedef struct
208 {
212  unsigned int attributeIndex;
214  unsigned int attributeValue;
216  float attributeConfidence;
220  char *attributeLabel;
222 
226 typedef enum {
253 
257 typedef enum {
263 
271 const char* NvDsInferStatus2Str(NvDsInferStatus status);
272 
273 #ifdef __cplusplus
274 }
275 #endif
276 
277 /* C++ data types */
278 #ifdef __cplusplus
279 
284 typedef enum
285 {
286  kSELECTOR_MIN = 0,
287  kSELECTOR_OPT,
288  kSELECTOR_MAX,
289  kSELECTOR_SIZE
290 } NvDsInferProfileSelector;
291 
295 typedef struct
296 {
297  int batchSize = 0;
298  NvDsInferDims dims = {0};
299 } NvDsInferBatchDims;
300 
305 struct NvDsInferBatchDimsLayerInfo : NvDsInferLayerInfo
306 {
307  NvDsInferBatchDims profileDims[kSELECTOR_SIZE];
308 };
309 
310 #endif
311 
312 #endif
313 
NvDsInferStatus2Str
const char * NvDsInferStatus2Str(NvDsInferStatus status)
Get the string name for the status.
UINT8
@ UINT8
Specifies UINT8 format.
Definition: 9.0/sources/includes/nvdsinfer.h:85
NVDSINFER_TRTIS_ERROR
@ NVDSINFER_TRTIS_ERROR
[deprecated]TRT-IS error was encountered
Definition: 9.0/sources/includes/nvdsinfer.h:247
NVDSINFER_LOG_ERROR
@ NVDSINFER_LOG_ERROR
Definition: 9.0/sources/includes/nvdsinfer.h:258
NvDsInferDims
Holds the dimensions of a layer.
Definition: sources/includes/nvdsinfer.h:46
NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: 9.0/sources/includes/nvdsinfer.h:228
NvDsInferLogLevel
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
Definition: 9.0/sources/includes/nvdsinfer.h:257
NVDSINFER_TENSORRT_ERROR
@ NVDSINFER_TENSORRT_ERROR
TensorRT interface failed.
Definition: 9.0/sources/includes/nvdsinfer.h:241
NVDSINFER_LOG_INFO
@ NVDSINFER_LOG_INFO
Definition: 9.0/sources/includes/nvdsinfer.h:260
NvDsInferDataType
NvDsInferDataType
Specifies the data type of a layer.
Definition: 9.0/sources/includes/nvdsinfer.h:72
NvDsInferInstanceMaskInfo
Holds information about one parsed object and instance mask from a detector's output.
Definition: sources/includes/nvdsinfer.h:176
NVDSINFER_UNKNOWN_ERROR
@ NVDSINFER_UNKNOWN_ERROR
Unknown error was encountered.
Definition: 9.0/sources/includes/nvdsinfer.h:251
NVDSINFER_TRITON_ERROR
@ NVDSINFER_TRITON_ERROR
Triton error was encountered.
Definition: 9.0/sources/includes/nvdsinfer.h:245
NvDsInferObjectDetectionInfo
Holds information about one parsed object from a detector's output.
Definition: sources/includes/nvdsinfer.h:145
FLOAT
@ FLOAT
Specifies FP32 format.
Definition: 9.0/sources/includes/nvdsinfer.h:75
NVDSINFER_LOG_WARNING
@ NVDSINFER_LOG_WARNING
Definition: 9.0/sources/includes/nvdsinfer.h:259
NVDSINFER_OUTPUT_PARSING_FAILED
@ NVDSINFER_OUTPUT_PARSING_FAILED
Output parsing failed.
Definition: 9.0/sources/includes/nvdsinfer.h:237
NVDSINFER_MAX_DIMS
#define NVDSINFER_MAX_DIMS
Definition: 9.0/sources/includes/nvdsinfer.h:39
NvDsInferNetworkInfo
Holds information about the model network.
Definition: sources/includes/nvdsinfer.h:114
NvDsInferLayerInfo
Holds information about one layer in the model.
Definition: sources/includes/nvdsinfer.h:91
HALF
@ HALF
Specifies FP16 format.
Definition: 9.0/sources/includes/nvdsinfer.h:77
INT32
@ INT32
Specifies INT32 format.
Definition: 9.0/sources/includes/nvdsinfer.h:81
INT8
@ INT8
Specifies INT8 format.
Definition: 9.0/sources/includes/nvdsinfer.h:79
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: 9.0/sources/includes/nvdsinfer.h:239
NvDsInferParseObjectInfo
NvDsInferObjectDetectionInfo NvDsInferParseObjectInfo
A typedef defined to maintain backward compatibility.
Definition: 9.0/sources/includes/nvdsinfer.h:171
NVDSINFER_CONFIG_FAILED
@ NVDSINFER_CONFIG_FAILED
Failed to configure the NvDsInferContext instance possibly due to an erroneous initialization propert...
Definition: 9.0/sources/includes/nvdsinfer.h:231
NvDsInferDimsCHW
Holds the dimensions of a three-dimensional layer.
Definition: sources/includes/nvdsinfer.h:59
NVDSINFER_INVALID_PARAMS
@ NVDSINFER_INVALID_PARAMS
Invalid parameters were supplied.
Definition: 9.0/sources/includes/nvdsinfer.h:235
INT64
@ INT64
Specifies INT64 format.
Definition: 9.0/sources/includes/nvdsinfer.h:83
NVDSINFER_LOG_DEBUG
@ NVDSINFER_LOG_DEBUG
Definition: 9.0/sources/includes/nvdsinfer.h:261
_DS_DEPRECATED_
#define _DS_DEPRECATED_(STR)
Definition: 9.0/sources/includes/nvdsinfer.h:41
NvDsInferAttribute
Holds information about one classified attribute.
Definition: sources/includes/nvdsinfer.h:207
NVDSINFER_RESOURCE_ERROR
@ NVDSINFER_RESOURCE_ERROR
Resource error was encountered.
Definition: 9.0/sources/includes/nvdsinfer.h:243
NVDSINFER_CUSTOM_LIB_FAILED
@ NVDSINFER_CUSTOM_LIB_FAILED
Custom Library interface implementation failed.
Definition: 9.0/sources/includes/nvdsinfer.h:233
NVDSINFER_MEM_ERROR
@ NVDSINFER_MEM_ERROR
Cuda Memory error was encountered.
Definition: 9.0/sources/includes/nvdsinfer.h:249
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: 9.0/sources/includes/nvdsinfer.h:226