83 #ifndef __NVDSINFER_CONTEXT_H__
84 #define __NVDSINFER_CONTEXT_H__
96 #define _PATH_MAX 4096
100 #define _MAX_CHANNELS 4
103 #define _MAX_STR_LENGTH 1024
106 #define NVDSINFER_MAX_BATCH_SIZE 1024
110 #define NVDSINFER_MIN_OUTPUT_BUFFERPOOL_SIZE 2
179 #define NvDsInferUffOrder _Pragma \
180 ("GCC warning \"'NvDsInferUffOrder' macro is deprecated. Use NvDsInferTensorOrder instead.\"") \
625 _DS_DEPRECATED_(
"NvDsInferContext_GetStatusName is deprecated. Use NvDsInferStatus2Str instead")
648 struct INvDsInferContext
698 virtual void fillLayersInfo(std::vector<NvDsInferLayerInfo> &layersInfo) = 0;
715 virtual const std::vector< std::vector<std::string> >& getLabels() = 0;
720 virtual void destroy() = 0;
723 virtual ~INvDsInferContext() {}
752 void *userCtx =
nullptr,
876 unsigned int id,
unsigned int value);
float height
Holds the object's height.
unsigned int maxBatchSize
Holds the maximum number of frames to be inferred together in a batch.
NvDsInferTensorOrder
Defines UFF input layer orders.
NvDsInferNetworkMode
Defines internal data formats used by the inference engine.
NvDsInferStatus NvDsInferContext_QueueInputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchInput *batchInput)
Queues a batch of input frames for preprocessing and inferencing.
void NvDsInferContext_GetNetworkInfo(NvDsInferContextHandle handle, NvDsInferNetworkInfo *networkInfo)
Gets network input information.
Holds detection and bounding box grouping parameters.
NvDsInferStatus NvDsInferContext_Create(NvDsInferContextHandle *handle, NvDsInferContextInitParams *initParams, void *userCtx, NvDsInferContextLoggingFunc logFunc)
Creates a new NvDsInferContext object with specified initialization parameters.
char modelEngineFilePath[_PATH_MAX]
Holds the pathname of the serialized model engine file.
int inputFromPreprocessedTensor
Boolean flag indicating that caller will supply preprocessed tensors for inferencing.
float preClusterThreshold
void NvDsInferContext_Destroy(NvDsInferContextHandle handle)
Destroys an NvDsInferContext instance and releases its resources.
NvDsInferNetworkMode networkMode
Holds an internal data format specifier used by the inference engine.
unsigned int numInputTensors
Holds the number of input tensors.
char uffInputBlobName[_MAX_STR_LENGTH]
Holds the name of the input layer for the UFF model.
Holds the initialization parameters required for the NvDsInferContext interface.
NvDsInferTensorOrder netInputOrder
Holds the original input order for the network.
unsigned int gpuID
Holds the ID of the GPU which is to run the inference.
NvDsInferTensorOrder uffInputOrder
Holds the original input order for the UFF model.
NvDsInferClusterMode clusterMode
Holds the type of clustering mode.
Holds information about one classified attribute.
int copyInputToHostBuffers
Holds a Boolean; true if the input layer contents are to be copied to host memory for access by the a...
NvDsInferDimsCHW uffDimsCHW
Holds the input dimensions for the UFF model.
unsigned int mask_size
Holds size of mask in bytes.
NvDsInferFormat
Defines color formats.
void NvDsInferContext_ReleaseBatchOutput(NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput)
Frees the memory associated with the batch output and releases the set of host buffers back to the co...
#define _PATH_MAX
Maximum length of a file path parameter.
NvDsInferContext_GetStatusName is deprecated Use NvDsInferStatus2Str instead const char * NvDsInferContext_GetStatusName(NvDsInferStatus status)
Gets the string name of the status.
unsigned int mask_height
Holds height of mask.
unsigned int numDetectedClasses
Holds the number of classes detected by a detector network.
int classIndex
Holds the index for the object's class.
unsigned int mask_width
Holds width of mask.
void ** inputFrames
Holds a pointer to an array of pointers to input frame buffers.
char customEngineCreateFuncName[_MAX_STR_LENGTH]
Name of the custom engine creation function in the custom library.
unsigned int numInputFrames
Holds the number of input frames, i.e.
Holds the output for all of the frames in a batch (an array of frame), and related buffer information...
NvDsInferDetectionParams * perClassDetectionParams
Holds per-class detection parameters.
char meanImageFilePath[_PATH_MAX]
Holds the pathname of the mean image file (PPM format).
char * label
Holds a pointer to a string containing a label for the object.
void NvDsInferContext_FillLayersInfo(NvDsInferContextHandle handle, NvDsInferLayerInfo *layersInfo)
Fills an input vector with information about all of the bound layers of the inference engine in an Nv...
unsigned int numOutputDeviceBuffers
Holds the number of elements in *outputDeviceBuffers.
unsigned int uniqueID
Holds a unique identifier for the instance.
int dlaCore
Holds the ID of the DLA core to use.
unsigned int outputBufferPoolSize
Holds the number of sets of output buffers (host and device) to be allocated.
float left
Holds the object's offset from the left boundary of the frame.
char protoFilePath[_PATH_MAX]
Holds the pathname of the prototxt file.
float width
Holds the object's width.
float segmentationThreshold
NvDsInferNetworkType outputType
Holds an output type indicating the valid member in the union of detectionOutput, classificationOutpu...
Specifies 8-bit Luma format.
unsigned int numOutputLayers
Holds the number of output layer names.
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
NvDsInferNetworkType networkType
Holds the network type.
unsigned int numHostBuffers
Holds the number of elements in hostBuffers.
NvDsInferContextReturnInputAsyncFunc returnInputFunc
Holds a callback for returning the input buffers to the client.
float * class_probability_map
Holds a pointer to an array containing raw probabilities.
char ** layerDevicePrecisions
Can be used to specify the device type and inference precision of layers.
float classifierThreshold
Holds the minimum confidence threshold for the classifier to consider a label valid.
#define _DS_DEPRECATED_(STR)
void * priv
Holds a private context pointer for the set of output buffers.
char int8CalibrationFilePath[_PATH_MAX]
Holds the pathname of the INT8 calibration file.
float offsets[_MAX_CHANNELS]
Holds the per-channel offsets for mean subtraction.
NVIDIA DeepStream inference specifications
Use NvDsInferClusterMode instead int useDBScan
Holds a Boolean; true if DBScan is to be used for object clustering, or false if OpenCV groupRectangl...
char tltEncodedModelFilePath[_PATH_MAX]
Holds the pathname of the TLT encoded model file.
#define _MAX_STR_LENGTH
Defines the maximum length of string parameters.
Holds information about one batch to be inferred.
void(* NvDsInferContextReturnInputAsyncFunc)(void *data)
Defines a callback function type for asynchronously returning the input client buffers to the NvDsInf...
unsigned int numLayerDevicePrecisions
Holds number of layer device precisions specified.
char ** outputLayerNames
Holds a pointer to an array of pointers to output layer names.
void(* NvDsInferContextLoggingFunc)(NvDsInferContextHandle handle, unsigned int uniqueID, NvDsInferLogLevel logLevel, const char *logMessage, void *userCtx)
Type declaration for a logging callback.
Holds information about one detected object.
NvDsInferClassificationOutput classificationOutput
Holds classifier output.
char onnxFilePath[_PATH_MAX]
Holds the pathname of the ONNX model file.
Holds information on all attributes classifed by a classifier network for one frame.
Specifies 24-bit interleaved R-G-B format.
unsigned int numAttributes
Holds the size of the attributes array.
float postClusterThreshold
Hold the bounding box detection threshold to be applied post clustering operation.
NvDsInferDetectionOutput detectionOutput
Holds detector output.
NvDsInferFormat networkInputFormat
Holds the network input format.
NvDsInferAttribute * attributes
Holds a pointer to an array of attributes.
Holds information parsed from segmentation network output for one frame.
struct INvDsInferContext * NvDsInferContextHandle
An opaque pointer type to be used as a handle for a context instance.
char customNetworkConfigFilePath[_PATH_MAX]
Holds the pathname of the configuration file for custom network creation.
const char * NvDsInferContext_GetLabel(NvDsInferContextHandle handle, unsigned int id, unsigned int value)
Gets the string label associated with the class ID for detectors and the attribute ID and attribute v...
unsigned int height
Holds the height of the output.
char customBBoxParseFuncName[_MAX_STR_LENGTH]
Holds the name of the custom bounding box function in the custom library.
Holds information on all objects detected by a detector network in one frame.
void NvDsInferContext_ResetInitParams(NvDsInferContextInitParams *initParams)
Resets a context parameter structure to default values.
#define _MAX_CHANNELS
Defines the maximum number of channels supported by the API for image input layers.
Specifies a segmentation network.
unsigned int NvDsInferContext_GetNumLayersInfo(NvDsInferContextHandle handle)
Gets the number of the bound layers of the inference engine in an NvDsInferContext instance...
Specifies 32-bit interleaved R-G-B-A format.
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
unsigned int numOutputIOFormats
Holds number of output IO formats specified.
char tltModelKey[_MAX_STR_LENGTH]
Holds the string key for decoding the TLT encoded model.
NvDsInferTensorOrder segmentationOutputOrder
Holds output order for segmentation network.
unsigned int numObjects
Holds the number of objects in objects.
char labelsFilePath[_PATH_MAX]
Holds the pathname of the labels file containing strings for the class labels.
unsigned int classes
Holds the number of classes supported by the network.
void * returnFuncData
A pointer to the data to be supplied with the callback in returnInputFunc.
NvDsInferNetworkType
Defines network types.
NvDsInferDimsCHW inferInputDims
Inference input dimensions for runtime engine.
int forceImplicitBatchDimension
For model parsers supporting both implicit batch dim and full dims, prefer to use implicit batch dim...
NvDsInferLayerInfo * tensors
char uffFilePath[_PATH_MAX]
Holds the pathname of the UFF model file.
unsigned int inputPitch
Holds the pitch of the input frames, in bytes.
unsigned int width
Holds the width of the output.
char modelFilePath[_PATH_MAX]
Holds the pathname of the caffemodel file.
NvDsInferObject * objects
Holds a pointer to an array of objects.
Holds the information inferred by the network on one frame.
int topK
Number of objects with objects to be filtered in the decensding order of probability.
float nmsIOUThreshold
IOU threshold to be used with NMS mode of clustering.
Holds information about the model network.
void ** hostBuffers
Holds a pointer to an array of pointers to host buffers for this batch.
float eps
Holds the epsilon to control merging of overlapping boxes.
NvDsInferSegmentationOutput segmentationOutput
Holds classifier output.
Holds the dimensions of a three-dimensional layer.
char customLibPath[_PATH_MAX]
Holds the pathname of the library containing custom methods required to support the network...
NvDsInferDimsCHW inputDims
Holds the input dimensions for the model.
int useDLA
Holds a Boolean; true if DLA is to be used.
NvDsInferFrameOutput * frames
Holds a pointer to an array of outputs for each frame in the batch.
Holds information about one layer in the model.
char * label
Holds a pointer to a string containing a label for the classified output.
Specifies 24-bit interleaved B-G-R format.
int groupThreshold
Holds the minimum number boxes in a cluster to be considered an object during grouping using OpenCV g...
NvDsInferClusterMode
Enum for clustering mode for detectors.
int * class_map
Holds a pointer to an array for the 2D pixel class map.
unsigned int numFrames
Holds the number of elements in frames.
char customBBoxInstanceMaskParseFuncName[_MAX_STR_LENGTH]
Holds the name of the bounding box and instance mask parse function in the custom library...
NvDsInferFormat inputFormat
Holds the format of the frame contents.
unsigned int workspaceSize
Max workspace size (unit MB) that will be used as tensorrt build settings for cuda engine...
float networkScaleFactor
Holds the normalization factor with which to scale the input pixels.
float minScore
Minimum score in a cluster for the cluster to be considered an object during grouping.
Specifies 32-bit interleaved B-G-R-x format.
float top
Holds the object's offset from the top boundary of the frame.
Specifies a instance segmentation network.
NvDsInferStatus NvDsInferContext_DequeueOutputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput)
Dequeues output for a batch of frames.
void * returnFuncData
A pointer to the data to be supplied with the callback in returnInputFunc.
int minBoxes
Holds the minimum number of boxes in a cluster to be considered an object during grouping using DBSCA...
char ** outputIOFormats
Can be used to specify the format and datatype for bound output layers.
void ** outputDeviceBuffers
Holds a pointer to an array of pointers to output device buffers for this batch.
NvDsInferContextReturnInputAsyncFunc returnInputFunc
Holds a callback for returning the input buffers to the client.
char customClassifierParseFuncName[_MAX_STR_LENGTH]
Name of the custom classifier attribute parsing function in the custom library.