NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/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: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
34 #ifndef _NVDSINFER_H_
35 #define _NVDSINFER_H_
36 
37 #include <stdint.h>
38 
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #endif
43 
44 #define NVDSINFER_MAX_DIMS 8
45 
46 #define _DS_DEPRECATED_(STR) __attribute__ ((deprecated (STR)))
47 
51 typedef struct
52 {
54  unsigned int numDims;
56  unsigned int d[NVDSINFER_MAX_DIMS];
58  unsigned int numElements;
60 
64 typedef struct
65 {
67  unsigned int c;
69  unsigned int h;
71  unsigned int w;
73 
77 typedef enum
78 {
80  FLOAT = 0,
82  HALF = 1,
84  INT8 = 2,
86  INT32 = 3,
88  INT64 = 4,
90  UINT8 = 5
92 
96 typedef struct
97 {
99  NvDsInferDataType dataType;
101  union {
102  NvDsInferDims inferDims;
103  NvDsInferDims dims _DS_DEPRECATED_("dims is deprecated. Use inferDims instead");
104  };
106  int bindingIndex;
108  const char* layerName;
110  void *buffer;
113  int isInput;
115 
119 typedef struct
120 {
122  unsigned int width;
124  unsigned int height;
126  unsigned int channels;
128 
133 #define getDimsCHWFromDims(dimsCHW,dims) \
134  do { \
135  (dimsCHW).c = (dims).d[0]; \
136  (dimsCHW).h = (dims).d[1]; \
137  (dimsCHW).w = (dims).d[2]; \
138  } while (0)
139 
140 #define getDimsHWCFromDims(dimsCHW,dims) \
141  do { \
142  (dimsCHW).h = (dims).d[0]; \
143  (dimsCHW).w = (dims).d[1]; \
144  (dimsCHW).c = (dims).d[2]; \
145  } while (0)
146 
150 typedef struct
151 {
153  unsigned int classId;
154 
156  float left;
158  float top;
160  float width;
162  float height;
163 
166  float detectionConfidence;
167 
170  float rotation_angle;
172 
177 
181 typedef struct
182 {
184  unsigned int classId;
185 
187  float left;
189  float top;
191  float width;
193  float height;
194 
197  float detectionConfidence;
198 
200  float *mask;
202  unsigned int mask_width;
204  unsigned int mask_height;
206  unsigned int mask_size;
208 
212 typedef struct
213 {
217  unsigned int attributeIndex;
219  unsigned int attributeValue;
221  float attributeConfidence;
225  char *attributeLabel;
227 
231 typedef enum {
258 
262 typedef enum {
268 
276 const char* NvDsInferStatus2Str(NvDsInferStatus status);
277 
278 #ifdef __cplusplus
279 }
280 #endif
281 
282 /* C++ data types */
283 #ifdef __cplusplus
284 
289 typedef enum
290 {
291  kSELECTOR_MIN = 0,
292  kSELECTOR_OPT,
293  kSELECTOR_MAX,
294  kSELECTOR_SIZE
295 } NvDsInferProfileSelector;
296 
300 typedef struct
301 {
302  int batchSize = 0;
303  NvDsInferDims dims = {0};
304 } NvDsInferBatchDims;
305 
310 struct NvDsInferBatchDimsLayerInfo : NvDsInferLayerInfo
311 {
312  NvDsInferBatchDims profileDims[kSELECTOR_SIZE];
313 };
314 
315 #endif
316 
317 #endif
318 
NvDsInferStatus2Str
const char * NvDsInferStatus2Str(NvDsInferStatus status)
Get the string name for the status.
UINT8
@ UINT8
Specifies UINT8 format.
Definition: 9.1/sources/includes/nvdsinfer.h:90
NVDSINFER_TRTIS_ERROR
@ NVDSINFER_TRTIS_ERROR
[deprecated]TRT-IS error was encountered
Definition: 9.1/sources/includes/nvdsinfer.h:252
NVDSINFER_LOG_ERROR
@ NVDSINFER_LOG_ERROR
Definition: 9.1/sources/includes/nvdsinfer.h:263
NvDsInferDims
Holds the dimensions of a layer.
Definition: sources/includes/nvdsinfer.h:51
NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: 9.1/sources/includes/nvdsinfer.h:233
NvDsInferLogLevel
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
Definition: 9.1/sources/includes/nvdsinfer.h:262
NVDSINFER_TENSORRT_ERROR
@ NVDSINFER_TENSORRT_ERROR
TensorRT interface failed.
Definition: 9.1/sources/includes/nvdsinfer.h:246
NVDSINFER_LOG_INFO
@ NVDSINFER_LOG_INFO
Definition: 9.1/sources/includes/nvdsinfer.h:265
NvDsInferDataType
NvDsInferDataType
Specifies the data type of a layer.
Definition: 9.1/sources/includes/nvdsinfer.h:77
NvDsInferInstanceMaskInfo
Holds information about one parsed object and instance mask from a detector's output.
Definition: sources/includes/nvdsinfer.h:181
NVDSINFER_UNKNOWN_ERROR
@ NVDSINFER_UNKNOWN_ERROR
Unknown error was encountered.
Definition: 9.1/sources/includes/nvdsinfer.h:256
NVDSINFER_TRITON_ERROR
@ NVDSINFER_TRITON_ERROR
Triton error was encountered.
Definition: 9.1/sources/includes/nvdsinfer.h:250
NvDsInferObjectDetectionInfo
Holds information about one parsed object from a detector's output.
Definition: sources/includes/nvdsinfer.h:150
FLOAT
@ FLOAT
Specifies FP32 format.
Definition: 9.1/sources/includes/nvdsinfer.h:80
NVDSINFER_LOG_WARNING
@ NVDSINFER_LOG_WARNING
Definition: 9.1/sources/includes/nvdsinfer.h:264
NVDSINFER_OUTPUT_PARSING_FAILED
@ NVDSINFER_OUTPUT_PARSING_FAILED
Output parsing failed.
Definition: 9.1/sources/includes/nvdsinfer.h:242
NVDSINFER_MAX_DIMS
#define NVDSINFER_MAX_DIMS
Definition: 9.1/sources/includes/nvdsinfer.h:44
NvDsInferNetworkInfo
Holds information about the model network.
Definition: sources/includes/nvdsinfer.h:119
NvDsInferLayerInfo
Holds information about one layer in the model.
Definition: sources/includes/nvdsinfer.h:96
HALF
@ HALF
Specifies FP16 format.
Definition: 9.1/sources/includes/nvdsinfer.h:82
INT32
@ INT32
Specifies INT32 format.
Definition: 9.1/sources/includes/nvdsinfer.h:86
INT8
@ INT8
Specifies INT8 format.
Definition: 9.1/sources/includes/nvdsinfer.h:84
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: 9.1/sources/includes/nvdsinfer.h:244
NvDsInferParseObjectInfo
NvDsInferObjectDetectionInfo NvDsInferParseObjectInfo
A typedef defined to maintain backward compatibility.
Definition: 9.1/sources/includes/nvdsinfer.h:176
NVDSINFER_CONFIG_FAILED
@ NVDSINFER_CONFIG_FAILED
Failed to configure the NvDsInferContext instance possibly due to an erroneous initialization propert...
Definition: 9.1/sources/includes/nvdsinfer.h:236
NvDsInferDimsCHW
Holds the dimensions of a three-dimensional layer.
Definition: sources/includes/nvdsinfer.h:64
NVDSINFER_INVALID_PARAMS
@ NVDSINFER_INVALID_PARAMS
Invalid parameters were supplied.
Definition: 9.1/sources/includes/nvdsinfer.h:240
INT64
@ INT64
Specifies INT64 format.
Definition: 9.1/sources/includes/nvdsinfer.h:88
NVDSINFER_LOG_DEBUG
@ NVDSINFER_LOG_DEBUG
Definition: 9.1/sources/includes/nvdsinfer.h:266
_DS_DEPRECATED_
#define _DS_DEPRECATED_(STR)
Definition: 9.1/sources/includes/nvdsinfer.h:46
NvDsInferAttribute
Holds information about one classified attribute.
Definition: sources/includes/nvdsinfer.h:212
NVDSINFER_RESOURCE_ERROR
@ NVDSINFER_RESOURCE_ERROR
Resource error was encountered.
Definition: 9.1/sources/includes/nvdsinfer.h:248
NVDSINFER_CUSTOM_LIB_FAILED
@ NVDSINFER_CUSTOM_LIB_FAILED
Custom Library interface implementation failed.
Definition: 9.1/sources/includes/nvdsinfer.h:238
NVDSINFER_MEM_ERROR
@ NVDSINFER_MEM_ERROR
Cuda Memory error was encountered.
Definition: 9.1/sources/includes/nvdsinfer.h:254
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: 9.1/sources/includes/nvdsinfer.h:231