NVIDIA DeepStream SDK API Reference

6.2 Release
nvdsinfer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2020, 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 
28 #ifndef _NVDSINFER_H_
29 #define _NVDSINFER_H_
30 
31 #include <stdint.h>
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37 
38 #define NVDSINFER_MAX_DIMS 8
39 
40 #define _DS_DEPRECATED_(STR) __attribute__ ((deprecated (STR)))
41 
45 typedef struct
46 {
48  unsigned int numDims;
50  unsigned int d[NVDSINFER_MAX_DIMS];
52  unsigned int numElements;
54 
58 typedef struct
59 {
61  unsigned int c;
63  unsigned int h;
65  unsigned int w;
67 
71 typedef enum
72 {
74  FLOAT = 0,
76  HALF = 1,
78  INT8 = 2,
80  INT32 = 3
82 
86 typedef struct
87 {
91  union {
93  NvDsInferDims dims _DS_DEPRECATED_("dims is deprecated. Use inferDims instead");
94  };
98  const char* layerName;
100  void *buffer;
103  int isInput;
105 
109 typedef struct
110 {
112  unsigned int width;
114  unsigned int height;
116  unsigned int channels;
118 
123 #define getDimsCHWFromDims(dimsCHW,dims) \
124  do { \
125  (dimsCHW).c = (dims).d[0]; \
126  (dimsCHW).h = (dims).d[1]; \
127  (dimsCHW).w = (dims).d[2]; \
128  } while (0)
129 
130 #define getDimsHWCFromDims(dimsCHW,dims) \
131  do { \
132  (dimsCHW).h = (dims).d[0]; \
133  (dimsCHW).w = (dims).d[1]; \
134  (dimsCHW).c = (dims).d[2]; \
135  } while (0)
136 
140 typedef struct
141 {
143  unsigned int classId;
144 
146  float left;
148  float top;
150  float width;
152  float height;
153 
158 
163 
167 typedef struct
168 {
170  unsigned int classId;
171 
173  float left;
175  float top;
177  float width;
179  float height;
180 
184 
186  float *mask;
188  unsigned int mask_width;
190  unsigned int mask_height;
192  unsigned int mask_size;
194 
198 typedef struct
199 {
203  unsigned int attributeIndex;
205  unsigned int attributeValue;
213 
217 typedef enum {
242 
246 typedef enum {
252 
260 const char* NvDsInferStatus2Str(NvDsInferStatus status);
261 
262 #ifdef __cplusplus
263 }
264 #endif
265 
266 /* C++ data types */
267 #ifdef __cplusplus
268 
273 typedef enum
274 {
275  kSELECTOR_MIN = 0,
276  kSELECTOR_OPT,
277  kSELECTOR_MAX,
278  kSELECTOR_SIZE
279 } NvDsInferProfileSelector;
280 
284 typedef struct
285 {
286  int batchSize = 0;
287  NvDsInferDims dims = {0};
288 } NvDsInferBatchDims;
289 
294 struct NvDsInferBatchDimsLayerInfo : NvDsInferLayerInfo
295 {
296  NvDsInferBatchDims profileDims[kSELECTOR_SIZE];
297 };
298 
299 #endif
300 
301 #endif
302 
NvDsInferAttribute::attributeLabel
char * attributeLabel
Holds a pointer to a string containing the attribute's label.
Definition: nvdsinfer.h:211
NvDsInferDimsCHW::w
unsigned int w
Holds the width of the layer.
Definition: nvdsinfer.h:65
NvDsInferInstanceMaskInfo::left
float left
Holds the horizontal offset of the bounding box shape for the object.
Definition: nvdsinfer.h:173
NvDsInferInstanceMaskInfo::width
float width
Holds the width of the object's bounding box.
Definition: nvdsinfer.h:177
NvDsInferAttribute::attributeIndex
unsigned int attributeIndex
Holds the index of the attribute's label.
Definition: nvdsinfer.h:203
NvDsInferInstanceMaskInfo::classId
unsigned int classId
Holds the ID of the class to which the object belongs.
Definition: nvdsinfer.h:170
NvDsInferObjectDetectionInfo::width
float width
Holds the width of the object's bounding box.
Definition: nvdsinfer.h:150
NvDsInferDims::numElements
unsigned int numElements
Holds the number of elements in the layer, including all dimensions.
Definition: nvdsinfer.h:52
NvDsInferObjectDetectionInfo::left
float left
Holds the horizontal offset of the bounding box shape for the object.
Definition: nvdsinfer.h:146
NVDSINFER_TRTIS_ERROR
@ NVDSINFER_TRTIS_ERROR
[deprecated]TRT-IS error was encountered
Definition: nvdsinfer.h:238
NVDSINFER_LOG_ERROR
@ NVDSINFER_LOG_ERROR
Definition: nvdsinfer.h:247
NvDsInferDims
Holds the dimensions of a layer.
Definition: nvdsinfer.h:45
NVDSINFER_SUCCESS
@ NVDSINFER_SUCCESS
NvDsInferContext operation succeeded.
Definition: nvdsinfer.h:219
NvDsInferDimsCHW::h
unsigned int h
Holds the height of the layer.
Definition: nvdsinfer.h:63
NvDsInferLogLevel
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
Definition: nvdsinfer.h:246
NvDsInferLayerInfo::bindingIndex
int bindingIndex
Holds the TensorRT binding index of the layer.
Definition: nvdsinfer.h:96
NVDSINFER_TENSORRT_ERROR
@ NVDSINFER_TENSORRT_ERROR
TensorRT interface failed.
Definition: nvdsinfer.h:232
NVDSINFER_LOG_INFO
@ NVDSINFER_LOG_INFO
Definition: nvdsinfer.h:249
NvDsInferDataType
NvDsInferDataType
Specifies the data type of a layer.
Definition: nvdsinfer.h:71
NvDsInferInstanceMaskInfo
Holds information about one parsed object and instance mask from a detector's output.
Definition: nvdsinfer.h:167
NvDsInferInstanceMaskInfo::detectionConfidence
float detectionConfidence
Holds the object detection confidence level; must in the range [0.0,1.0].
Definition: nvdsinfer.h:183
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:192
NVDSINFER_UNKNOWN_ERROR
@ NVDSINFER_UNKNOWN_ERROR
Unknown error was encountered.
Definition: nvdsinfer.h:240
NvDsInferObjectDetectionInfo::classId
unsigned int classId
Holds the ID of the class to which the object belongs.
Definition: nvdsinfer.h:143
NvDsInferNetworkInfo::height
unsigned int height
Holds the input height for the model.
Definition: nvdsinfer.h:114
NVDSINFER_TRITON_ERROR
@ NVDSINFER_TRITON_ERROR
Triton error was encountered.
Definition: nvdsinfer.h:236
NvDsInferObjectDetectionInfo
Holds information about one parsed object from a detector's output.
Definition: nvdsinfer.h:140
FLOAT
@ FLOAT
Specifies FP32 format.
Definition: nvdsinfer.h:74
NVDSINFER_LOG_WARNING
@ NVDSINFER_LOG_WARNING
Definition: nvdsinfer.h:248
NVDSINFER_OUTPUT_PARSING_FAILED
@ NVDSINFER_OUTPUT_PARSING_FAILED
Output parsing failed.
Definition: nvdsinfer.h:228
NVDSINFER_MAX_DIMS
#define NVDSINFER_MAX_DIMS
Definition: nvdsinfer.h:38
NvDsInferNetworkInfo
Holds information about the model network.
Definition: nvdsinfer.h:109
NvDsInferLayerInfo
Holds information about one layer in the model.
Definition: nvdsinfer.h:86
NvDsInferNetworkInfo::channels
unsigned int channels
Holds the number of input channels for the model.
Definition: nvdsinfer.h:116
HALF
@ HALF
Specifies FP16 format.
Definition: nvdsinfer.h:76
INT32
@ INT32
Specifies INT32 format.
Definition: nvdsinfer.h:80
NvDsInferLayerInfo::buffer
void * buffer
Holds a pointer to the buffer for the layer data.
Definition: nvdsinfer.h:100
NvDsInferInstanceMaskInfo::mask_height
unsigned int mask_height
Holds height of mask.
Definition: nvdsinfer.h:190
NvDsInferObjectDetectionInfo::top
float top
Holds the vertical offset of the object's bounding box.
Definition: nvdsinfer.h:148
NvDsInferLayerInfo::inferDims
NvDsInferDims inferDims
Definition: nvdsinfer.h:92
NvDsInferInstanceMaskInfo::top
float top
Holds the vertical offset of the object's bounding box.
Definition: nvdsinfer.h:175
INT8
@ INT8
Specifies INT8 format.
Definition: nvdsinfer.h:78
NvDsInferInstanceMaskInfo::mask
float * mask
Holds object segment mask.
Definition: nvdsinfer.h:186
NVDSINFER_CUDA_ERROR
@ NVDSINFER_CUDA_ERROR
CUDA error was encountered.
Definition: nvdsinfer.h:230
NvDsInferLayerInfo::dataType
NvDsInferDataType dataType
Holds the data type of the layer.
Definition: nvdsinfer.h:89
NvDsInferParseObjectInfo
NvDsInferObjectDetectionInfo NvDsInferParseObjectInfo
A typedef defined to maintain backward compatibility.
Definition: nvdsinfer.h:162
NvDsInferNetworkInfo::width
unsigned int width
Holds the input width for the model.
Definition: nvdsinfer.h:112
NVDSINFER_CONFIG_FAILED
@ NVDSINFER_CONFIG_FAILED
Failed to configure the NvDsInferContext instance possibly due to an erroneous initialization propert...
Definition: nvdsinfer.h:222
NvDsInferInstanceMaskInfo::height
float height
Holds the height of the object's bounding box.
Definition: nvdsinfer.h:179
NvDsInferDimsCHW
Holds the dimensions of a three-dimensional layer.
Definition: nvdsinfer.h:58
NvDsInferLayerInfo::isInput
int isInput
Holds a Boolean; true if the layer is an input layer, or false if an output layer.
Definition: nvdsinfer.h:103
NvDsInferDims::numDims
unsigned int numDims
Holds the number of dimesions in the layer.
Definition: nvdsinfer.h:48
NVDSINFER_INVALID_PARAMS
@ NVDSINFER_INVALID_PARAMS
Invalid parameters were supplied.
Definition: nvdsinfer.h:226
NvDsInferAttribute::attributeConfidence
float attributeConfidence
Holds the attribute's confidence level.
Definition: nvdsinfer.h:207
NvDsInferLayerInfo::layerName
const char * layerName
Holds the name of the layer.
Definition: nvdsinfer.h:98
NvDsInferObjectDetectionInfo::height
float height
Holds the height of the object's bounding box.
Definition: nvdsinfer.h:152
NvDsInferAttribute::attributeValue
unsigned int attributeValue
Holds the the attribute's output value.
Definition: nvdsinfer.h:205
NVDSINFER_LOG_DEBUG
@ NVDSINFER_LOG_DEBUG
Definition: nvdsinfer.h:250
_DS_DEPRECATED_
#define _DS_DEPRECATED_(STR)
Definition: nvdsinfer.h:40
NvDsInferInstanceMaskInfo::mask_width
unsigned int mask_width
Holds width of mask.
Definition: nvdsinfer.h:188
NvDsInferStatus
NvDsInferStatus
Definition: nvds_rest_server.h:53
NvDsInferAttribute
Holds information about one classified attribute.
Definition: nvdsinfer.h:198
NVDSINFER_RESOURCE_ERROR
@ NVDSINFER_RESOURCE_ERROR
Resource error was encountered.
Definition: nvdsinfer.h:234
NVDSINFER_CUSTOM_LIB_FAILED
@ NVDSINFER_CUSTOM_LIB_FAILED
Custom Library interface implementation failed.
Definition: nvdsinfer.h:224
NvDsInferObjectDetectionInfo::detectionConfidence
float detectionConfidence
Holds the object detection confidence level; must in the range [0.0,1.0].
Definition: nvdsinfer.h:156
NvDsInferDimsCHW::c
unsigned int c
Holds the channel count of the layer.
Definition: nvdsinfer.h:61
NvDsInferStatus
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
Definition: nvdsinfer.h:217