NVIDIA DeepStream SDK API Reference4.0.1 Release |
Defines the DeepStream inference interface API.
In C++, defines the NvDsInferContext class.
Data Structures | |
struct | NvDsInferDetectionParams |
Holds the detection and bounding box grouping parameters. More... | |
struct | _NvDsInferContextInitParams |
Holds the initialization parameters required for the NvDsInferContext interface. More... | |
struct | NvDsInferContextBatchInput |
Holds the information about one batch to be inferred. More... | |
struct | NvDsInferObject |
Holds the information about one detected object. More... | |
struct | NvDsInferDetectionOutput |
Holds the information on all objects detected by a detector network in one frame. More... | |
struct | NvDsInferClassificationOutput |
Holds the information on all attributes classifed by a classifier network for one frame. More... | |
struct | NvDsInferSegmentationOutput |
Holds the information parsed from segmentation network output for one frame. More... | |
struct | NvDsInferFrameOutput |
Holds the information inferred by the network on one frame. More... | |
struct | NvDsInferContextBatchOutput |
A batch is an array of frames. More... | |
NvDsInferContext API common types and functions. | |
This section describes the common types and functions for both the C and C++ interfaces for the NvDsInferContext class. | |
enum | NvDsInferNetworkMode { NvDsInferNetworkMode_FP32, NvDsInferNetworkMode_INT8, NvDsInferNetworkMode_FP16 } |
Enum for internal data format to be used by the inference engine. More... | |
enum | NvDsInferNetworkType { NvDsInferNetworkType_Detector, NvDsInferNetworkType_Classifier, NvDsInferNetworkType_Segmentation, NvDsInferNetworkType_Other = 100 } |
Enum for the type of the network. More... | |
enum | NvDsInferFormat { NvDsInferFormat_RGB, NvDsInferFormat_BGR, NvDsInferFormat_GRAY, NvDsInferFormat_RGBA, NvDsInferFormat_BGRx, NvDsInferFormat_Unknown = 0xFFFFFFFF } |
Enum for color formats. More... | |
enum | NvDsInferUffInputOrder { NvDsInferUffInputOrder_kNCHW, NvDsInferUffInputOrder_kNHWC, NvDsInferUffInputOrder_kNC } |
Enum for the UFF input layer order. More... | |
enum | NvDsInferStatus { NVDSINFER_SUCCESS = 0, NVDSINFER_CONFIG_FAILED, NVDSINFER_CUSTOM_LIB_FAILED, NVDSINFER_INVALID_PARAMS, NVDSINFER_OUTPUT_PARSING_FAILED, NVDSINFER_CUDA_ERROR, NVDSINFER_TENSORRT_ERROR, NVDSINFER_UNKNOWN_ERROR } |
Enum for the status codes returned by NvDsInferContext. More... | |
enum | NvDsInferLogLevel { NVDSINFER_LOG_ERROR, NVDSINFER_LOG_WARNING, NVDSINFER_LOG_INFO, NVDSINFER_LOG_DEBUG } |
Enum for the log levels of NvDsInferContext. More... | |
typedef struct _NvDsInferContextInitParams | NvDsInferContextInitParams |
Holds the initialization parameters required for the NvDsInferContext interface. More... | |
typedef void(* | NvDsInferContextReturnInputAsyncFunc )(void *data) |
Callback function type for returning the input client buffers back to the NvDsInferContext client asynchronously. More... | |
typedef struct INvDsInferContext * | NvDsInferContextHandle |
An opaque pointer type to be used as an handle for the context instance. More... | |
typedef void(* | NvDsInferContextLoggingFunc )(NvDsInferContextHandle handle, unsigned int uniqueID, NvDsInferLogLevel logLevel, const char *funcName, const char *logMessage, void *userCtx) |
Callback function type for logging the NvDsInferContext messages. More... | |
void | NvDsInferContext_ResetInitParams (NvDsInferContextInitParams *initParams) |
Reset the members of initialization parameters to default values. More... | |
const char * | NvDsInferContext_GetStatusName (NvDsInferStatus status) |
Get the string name for the status. More... | |
#define | _PATH_MAX 4096 |
Maximum length of a file path parameter. More... | |
#define | _MAX_CHANNELS 4 |
Maximum number of channels supported by the API for image input layers. More... | |
#define | _MAX_STR_LENGTH 1024 |
Maximum length of string parameters. More... | |
#define | NVDSINFER_MAX_BATCH_SIZE 1024 |
Maximum batch size to be supported by nvdsinfer. More... | |
#define | NVDSINFER_MIN_OUTPUT_BUFFERPOOL_SIZE 2 |
Minimum number of sets of output buffers that need to be allocated. More... | |
NvDsInferContext API C-interface | |
This section describes the C interface for the NvDsInferContext class. | |
NvDsInferStatus | NvDsInferContext_Create (NvDsInferContextHandle *handle, NvDsInferContextInitParams *initParams, void *userCtx, NvDsInferContextLoggingFunc logFunc) |
Creates a new instance of the NvDsInferContext class with the supplied initialization parameters. More... | |
void | NvDsInferContext_Destroy (NvDsInferContextHandle handle) |
Destroy a NvDsInferContext instance and release the associated resources. More... | |
NvDsInferStatus | NvDsInferContext_QueueInputBatch (NvDsInferContextHandle handle, NvDsInferContextBatchInput *batchInput) |
Queue a batch of input frames for pre-processing and inferencing. More... | |
NvDsInferStatus | NvDsInferContext_DequeueOutputBatch (NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput) |
Dequeue output for a batch of frames. More... | |
void | NvDsInferContext_ReleaseBatchOutput (NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput) |
Free the memory associated with the batch output and release the set of host buffers back to the context for re-use. More... | |
void | NvDsInferContext_GetNetworkInfo (NvDsInferContextHandle handle, NvDsInferNetworkInfo *networkInfo) |
Get the network input information. More... | |
unsigned int | NvDsInferContext_GetNumLayersInfo (NvDsInferContextHandle handle) |
Get the number of the bound layers of the inference engine in the NvDsInferContext instance. More... | |
void | NvDsInferContext_FillLayersInfo (NvDsInferContextHandle handle, NvDsInferLayerInfo *layersInfo) |
Fill the input vector with information on all the bound layers of the inference engine in the NvDsInferContext instance. More... | |
const char * | NvDsInferContext_GetLabel (NvDsInferContextHandle handle, unsigned int id, unsigned int value) |
Get the string label associated with the class_id for detectors and the attribute id and the attribute value for classifiers. More... | |
#define _MAX_CHANNELS 4 |
Maximum number of channels supported by the API for image input layers.
Definition at line 96 of file nvdsinfer_context.h.
#define _MAX_STR_LENGTH 1024 |
Maximum length of string parameters.
Definition at line 99 of file nvdsinfer_context.h.
#define _PATH_MAX 4096 |
Maximum length of a file path parameter.
Definition at line 93 of file nvdsinfer_context.h.
#define NVDSINFER_MAX_BATCH_SIZE 1024 |
Maximum batch size to be supported by nvdsinfer.
Definition at line 102 of file nvdsinfer_context.h.
#define NVDSINFER_MIN_OUTPUT_BUFFERPOOL_SIZE 2 |
Minimum number of sets of output buffers that need to be allocated.
Definition at line 105 of file nvdsinfer_context.h.
typedef struct INvDsInferContext* NvDsInferContextHandle |
An opaque pointer type to be used as an handle for the context instance.
Definition at line 480 of file nvdsinfer_context.h.
typedef struct _NvDsInferContextInitParams NvDsInferContextInitParams |
Holds the initialization parameters required for the NvDsInferContext interface.
typedef void(* NvDsInferContextLoggingFunc)(NvDsInferContextHandle handle, unsigned int uniqueID, NvDsInferLogLevel logLevel, const char *funcName, const char *logMessage, void *userCtx) |
Callback function type for logging the NvDsInferContext messages.
[in] | handle | Handle of the NvDsInferContext instance which generated the log. |
[in] | uniqueID | UniqueID of the NvDsInferContext instance which generated the log. |
[in] | logLevel | Level of the log. |
[in] | funcName | Name of the function which generated the log. |
[in] | logMessage | The log message string. |
[in] | userCtx | The opaque user context pointer supplied when creating the NvDsInferContext instance. |
Definition at line 494 of file nvdsinfer_context.h.
typedef void(* NvDsInferContextReturnInputAsyncFunc)(void *data) |
Callback function type for returning the input client buffers back to the NvDsInferContext client asynchronously.
[in] | data | The opaque pointer provided to input queueing function through NvDsInferContextBatchInput. |
Definition at line 347 of file nvdsinfer_context.h.
enum NvDsInferFormat |
Enum for color formats.
Definition at line 139 of file nvdsinfer_context.h.
enum NvDsInferLogLevel |
Enum for the log levels of NvDsInferContext.
Enumerator | |
---|---|
NVDSINFER_LOG_ERROR | |
NVDSINFER_LOG_WARNING | |
NVDSINFER_LOG_INFO | |
NVDSINFER_LOG_DEBUG |
Definition at line 210 of file nvdsinfer_context.h.
enum NvDsInferNetworkMode |
Enum for internal data format to be used by the inference engine.
Enumerator | |
---|---|
NvDsInferNetworkMode_FP32 | |
NvDsInferNetworkMode_INT8 | |
NvDsInferNetworkMode_FP16 |
Definition at line 110 of file nvdsinfer_context.h.
enum NvDsInferNetworkType |
Enum for the type of the network.
Definition at line 120 of file nvdsinfer_context.h.
enum NvDsInferStatus |
Enum for the status codes returned by NvDsInferContext.
Definition at line 186 of file nvdsinfer_context.h.
Enum for the UFF input layer order.
Enumerator | |
---|---|
NvDsInferUffInputOrder_kNCHW | |
NvDsInferUffInputOrder_kNHWC | |
NvDsInferUffInputOrder_kNC |
Definition at line 157 of file nvdsinfer_context.h.
NvDsInferStatus NvDsInferContext_Create | ( | NvDsInferContextHandle * | handle, |
NvDsInferContextInitParams * | initParams, | ||
void * | userCtx, | ||
NvDsInferContextLoggingFunc | logFunc | ||
) |
Creates a new instance of the NvDsInferContext class with the supplied initialization parameters.
[out] | handle | Pointer to a NvDsInferContext handle. |
[in] | initParams | Parameters to use for initialization of the context. |
[in] | userCtx | Pointer to an opaque user context supplied with callbacks generated by the NvDsInferContext instance. |
[in] | logFunc | Log callback function for the instance. |
NvDsInferStatus NvDsInferContext_DequeueOutputBatch | ( | NvDsInferContextHandle | handle, |
NvDsInferContextBatchOutput * | batchOutput | ||
) |
Dequeue output for a batch of frames.
Refer NvDsInferContext::dequeueOutputBatch() for details.
[in] | handle | Handle to a NvDsInferContext instance. |
[in,out] | batchOutput | Reference to the Batch output structure in which the output will be appended. |
void NvDsInferContext_Destroy | ( | NvDsInferContextHandle | handle | ) |
Destroy a NvDsInferContext instance and release the associated resources.
[in] | handle | Handle to the NvDsInferContext instance to be destroyed. |
void NvDsInferContext_FillLayersInfo | ( | NvDsInferContextHandle | handle, |
NvDsInferLayerInfo * | layersInfo | ||
) |
Fill the input vector with information on all the bound layers of the inference engine in the NvDsInferContext instance.
The size of the array has to be at least the value returned by NvDsInferContext_GetNumLayersInfo.
[in] | handle | Handle to a NvDsInferContext instance. |
[in,out] | layersInfo | Pointer to an array of NvDsInferLayerInfo which will be filled by the function. |
const char* NvDsInferContext_GetLabel | ( | NvDsInferContextHandle | handle, |
unsigned int | id, | ||
unsigned int | value | ||
) |
Get the string label associated with the class_id for detectors and the attribute id and the attribute value for classifiers.
The string is owned by the context. Callers should not modify or free the string.
[in] | handle | Handle to a NvDsInferContext instance. |
[in] | id | Class ID for detectors, Attribute ID for classifiers. |
[in] | value | Attribute value for classifiers, should be 0 for detectors. |
void NvDsInferContext_GetNetworkInfo | ( | NvDsInferContextHandle | handle, |
NvDsInferNetworkInfo * | networkInfo | ||
) |
Get the network input information.
[in] | handle | Handle to a NvDsInferContext instance. |
[in,out] | networkInfo | Pointer to a NvDsInferNetworkInfo structure. |
unsigned int NvDsInferContext_GetNumLayersInfo | ( | NvDsInferContextHandle | handle | ) |
Get the number of the bound layers of the inference engine in the NvDsInferContext instance.
[in] | handle | Handle to a NvDsInferContext instance. |
const char* NvDsInferContext_GetStatusName | ( | NvDsInferStatus | status | ) |
Get the string name for the status.
[in] | status | An NvDsInferStatus value. |
NvDsInferStatus NvDsInferContext_QueueInputBatch | ( | NvDsInferContextHandle | handle, |
NvDsInferContextBatchInput * | batchInput | ||
) |
Queue a batch of input frames for pre-processing and inferencing.
Refer NvDsInferContext::queueInputBatch() for details.
[in] | handle | Handle to a NvDsInferContext instance. |
[in] | batchInput | Reference to a batch input structure. |
void NvDsInferContext_ReleaseBatchOutput | ( | NvDsInferContextHandle | handle, |
NvDsInferContextBatchOutput * | batchOutput | ||
) |
Free the memory associated with the batch output and release the set of host buffers back to the context for re-use.
[in] | handle | Handle to a NvDsInferContext instance. |
[in] | batchOutput | Pointer to a NvDsInferContext_ReleaseBatchOutput structure which was filled by NvDsInferContext_DequeueOutputBatch(). |
void NvDsInferContext_ResetInitParams | ( | NvDsInferContextInitParams * | initParams | ) |
Reset the members of initialization parameters to default values.
[in] | initParams | Pointer to a NvDsInferContextInitParams structure. |