|
NVIDIA DeepStream SDK API Reference
|
7.1 Release
|
Go to the documentation of this file.
84 #ifndef __NVDSINFER_CONTEXT_H__
85 #define __NVDSINFER_CONTEXT_H__
97 #define _PATH_MAX 4096
101 #define _MAX_CHANNELS 4
104 #define _MAX_STR_LENGTH 1024
107 #define NVDSINFER_MAX_BATCH_SIZE 1024
111 #define NVDSINFER_MIN_OUTPUT_BUFFERPOOL_SIZE 2
185 #define NvDsInferUffOrder _Pragma \
186 ("GCC warning \"'NvDsInferUffOrder' macro is deprecated. Use NvDsInferTensorOrder instead.\"") \
536 unsigned int numObjects;
566 unsigned int classes;
573 float *class_probability_map;
670 _DS_DEPRECATED_(
"NvDsInferContext_GetStatusName is deprecated. Use NvDsInferStatus2Str instead")
693 struct INvDsInferContext
743 virtual void fillLayersInfo(std::vector<NvDsInferLayerInfo> &layersInfo) = 0;
760 virtual const std::vector< std::vector<std::string> >& getLabels() = 0;
765 virtual void destroy() = 0;
768 virtual ~INvDsInferContext() {}
797 void *userCtx =
nullptr,
921 unsigned int id,
unsigned int value);
int inputFromPreprocessedTensor
Boolean flag indicating that caller will supply preprocessed tensors for inferencing.
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...
NvDsInferClassificationOutput classificationOutput
Holds classifier output.
NvDsInferStatus NvDsInferContext_Create(NvDsInferContextHandle *handle, NvDsInferContextInitParams *initParams, void *userCtx, NvDsInferContextLoggingFunc logFunc)
Creates a new NvDsInferContext object with specified initialization parameters.
char customClassifierParseFuncName[_MAX_STR_LENGTH]
Name of the custom classifier attribute parsing function in the custom library.
unsigned int mask_width
Holds width of mask.
unsigned int workspaceSize
Max workspace size (unit MB) that will be used as tensorrt build settings for cuda engine.
NvDsInferTensorOrder
Defines UFF input layer orders.
char customBBoxInstanceMaskParseFuncName[_MAX_STR_LENGTH]
Holds the name of the bounding box and instance mask parse function in the custom library.
NvDsInferTensorOrder uffInputOrder
Holds the original input order for the UFF model.
@ NvDsInferNetworkType_Classifier
Specifies a classifier.
NvDsInferDetectionParams * perClassDetectionParams
Holds per-class detection parameters.
unsigned int NvDsInferContext_GetNumLayersInfo(NvDsInferContextHandle handle)
Gets the number of the bound layers of the inference engine in an NvDsInferContext instance.
@ NvDsInferNetworkMode_INT8
int dumpIpTensor
Boolean flag indicating whether or not to dump raw input tensor data.
NvDsInferFormat
Defines color formats.
char protoFilePath[_PATH_MAX]
Holds the pathname of the prototxt file.
NvDsInferTensorOrder netInputOrder
Holds the original input order for the network.
double maxGPUMemPer
Max gpu memory that can be occupied while expanding the bufferpool.
unsigned int maxBatchSize
Holds the maximum number of frames to be inferred together in a batch.
@ NVDSINFER_CLUSTER_GROUP_RECTANGLES
char customEngineCreateFuncName[_MAX_STR_LENGTH]
Name of the custom engine creation function in the custom library.
char ** layerDevicePrecisions
Can be used to specify the device type and inference precision of layers.
@ NvDsInferUffOrder_kNHWC
int copyInputToHostBuffers
Holds a Boolean; true if the input layer contents are to be copied to host memory for access by the a...
float preClusterThreshold
@ NvDsInferNetworkMode_FP16
@ NVDSINFER_CLUSTER_DBSCAN
NvDsInferNetworkType networkType
Holds the network type.
NvDsInferDimsCHW uffDimsCHW
Holds the input dimensions for the UFF model.
char int8CalibrationFilePath[_PATH_MAX]
Holds the pathname of the INT8 calibration file.
int overwriteOpTensor
Boolean flag indicating whether or not to overwrite raw ouput tensor data provided by the user into t...
NvDsInferContextReturnInputAsyncFunc returnInputFunc
Holds a callback for returning the input buffers to the client.
unsigned int gpuID
Holds the ID of the GPU which is to run the inference.
@ NvDsInferNetworkMode_BEST
void ** hostBuffers
Holds a pointer to an array of pointers to host buffers for this batch.
Holds the information parsed from segmentation network output for one frame.
NvDsInferContextReturnInputAsyncFunc returnInputFunc
Holds a callback for returning the input buffers to the client.
unsigned int mask_size
Holds size of mask in bytes.
unsigned int numDetectedClasses
Holds the number of classes detected by a detector network.
int disableOutputHostCopy
Boolean flag indicating that whether we will post processing on GPU if this flag enabled,...
unsigned int numInputTensors
Holds the number of input tensors.
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...
NvDsInferFrameOutput * frames
Holds a pointer to an array of outputs for each frame in the batch.
unsigned int outputBufferPoolSize
Holds the number of sets of output buffers (host and device) to be allocated.
char meanImageFilePath[_PATH_MAX]
Holds the pathname of the mean image file (PPM format).
int dlaCore
Holds the ID of the DLA core to use.
unsigned int uniqueID
Holds a unique identifier for the instance.
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
Use NvDsInferClusterMode instead int useDBScan
Holds a Boolean; true if DBScan is to be used for object clustering, or false if OpenCV groupRectangl...
void ** outputDeviceBuffers
Holds a pointer to an array of pointers to output device buffers for this batch.
unsigned int numInputFrames
Holds the number of input frames, i.e.
NvDsInferFormat networkInputFormat
Holds the network input format.
@ NVDSINFER_CLUSTER_DBSCAN_NMS_HYBRID
unsigned int numFrames
Holds the number of elements in frames.
float offsets[_MAX_CHANNELS]
Holds the per-channel offsets for mean subtraction.
#define _MAX_STR_LENGTH
Defines the maximum length of string parameters.
Holds information on all attributes classifed by a classifier network for one frame.
float segmentationThreshold
char tltEncodedModelFilePath[_PATH_MAX]
Holds the pathname of the TLT encoded model file.
@ NvDsInferNetworkType_Detector
Specifies a detector.
char ** outputLayerNames
Holds a pointer to an array of pointers to output layer names.
NvDsInferNetworkMode
Defines internal data formats used by the inference engine.
Holds information about one batch to be inferred.
int minBoxes
Holds the minimum number of boxes in a cluster to be considered an object during grouping using DBSCA...
void(* NvDsInferContextReturnInputAsyncFunc)(void *data)
Defines a callback function type for asynchronously returning the input client buffers to the NvDsInf...
NvDsInferLayerInfo * tensors
char ipTensorFilePath[_PATH_MAX]
Path to the raw input tensor data that is going to be used to overwrite the buffer.
@ NvDsInferFormat_RGB
Specifies 24-bit interleaved R-G-B format.
int dumpOpTensor
Boolean flag indicating whether or not to dump raw input tensor data.
NvDsInferClusterMode
Enum for clustering mode for detectors.
@ NvDsInferTensorOrder_kNC
@ NvDsInferNetworkMode_FP32
char onnxFilePath[_PATH_MAX]
Holds the pathname of the ONNX model file.
Holds the information on all objects detected by a detector network in one frame.
unsigned int numOutputLayers
Holds the number of output layer names.
NvDsInferSegmentationOutput segmentationOutput
Holds classifier output.
char customNetworkConfigFilePath[_PATH_MAX]
Holds the pathname of the configuration file for custom network creation.
Holds information about the model network.
unsigned int numAttributes
Holds the size of the attributes array.
char labelsFilePath[_PATH_MAX]
Holds the pathname of the labels file containing strings for the class labels.
float classifierThreshold
Holds the minimum confidence threshold for the classifier to consider a label valid.
Holds information about one layer in the model.
@ NvDsInferTensorOrder_kNHWC
float postClusterThreshold
Hold the bounding box detection threshold to be applied post clustering operation.
unsigned int mask_height
Holds height of mask.
struct INvDsInferContext * NvDsInferContextHandle
An opaque pointer type to be used as a handle for a context instance.
#define _PATH_MAX
Maximum length of a file path parameter.
int forceImplicitBatchDimension
For model parsers supporting both implicit batch dim and full dims, prefer to use implicit batch dim.
NvDsInferFormat inputFormat
Holds the format of the frame contents.
@ NvDsInferFormat_GRAY
Specifies 8-bit Luma format.
float minScore
Minimum score in a cluster for the cluster to be considered an object during grouping.
unsigned int numOutputIOFormats
Holds number of output IO formats specified.
NvDsInferContext_GetStatusName is deprecated Use NvDsInferStatus2Str const instead char * NvDsInferContext_GetStatusName(NvDsInferStatus status)
Gets the string name of the status.
unsigned int numLayerDevicePrecisions
Holds number of layer device precisions specified.
void NvDsInferContext_ResetInitParams(NvDsInferContextInitParams *initParams)
Resets a context parameter structure to default values.
char ** opTensorFilePath
List of paths to the raw output tensor data that are going to be used to overwrite the different outp...
@ NvDsInferTensorOrder_kNCHW
char customBBoxParseFuncName[_MAX_STR_LENGTH]
Holds the name of the custom bounding box function in the custom library.
int autoIncMem
Boolean flag indicating that whether we will automatically increase bufferpool size when facing a bot...
Holds the dimensions of a three-dimensional layer.
@ NvDsInferFormat_RGBA
Specifies 32-bit interleaved R-G-B-A format.
unsigned int inputPitch
Holds the pitch of the input frames, in bytes.
#define _MAX_CHANNELS
Defines the maximum number of channels supported by the API for image input layers.
int overwriteIpTensor
Boolean flag indicating whether or not to overwrite raw input tensor data provided by the user into t...
NvDsInferStatus NvDsInferContext_DequeueOutputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput)
Dequeues output for a batch of frames.
char customLibPath[_PATH_MAX]
Holds the pathname of the library containing custom methods required to support the network.
void NvDsInferContext_Destroy(NvDsInferContextHandle handle)
Destroys an NvDsInferContext instance and releases its resources.
NvDsInferStatus NvDsInferContext_QueueInputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchInput *batchInput)
Queues a batch of input frames for preprocessing and inferencing.
NvDsInferTensorOrder segmentationOutputOrder
Holds output order for segmentation network.
@ NvDsInferNetworkType_InstanceSegmentation
Specifies a instance segmentation network.
Holds the initialization parameters required for the NvDsInferContext interface.
unsigned int numOutputDeviceBuffers
Holds the number of elements in *outputDeviceBuffers.
@ NvDsInferFormat_Unknown
NvDsInferNetworkType outputType
Holds an output type indicating the valid member in the union of detectionOutput, classificationOutpu...
@ NvDsInferUffOrder_kNCHW
void NvDsInferContext_GetNetworkInfo(NvDsInferContextHandle handle, NvDsInferNetworkInfo *networkInfo)
Gets network input information.
float nmsIOUThreshold
IOU threshold to be used with NMS mode of clustering.
void * priv
Holds a private context pointer for the set of output buffers.
float networkScaleFactor
Holds the normalization factor with which to scale the input pixels.
int useDLA
Holds a Boolean; true if DLA is to be used.
@ NvDsInferFormat_Tensor
NCHW planar.
char tltModelKey[_MAX_STR_LENGTH]
Holds the string key for decoding the TLT encoded model.
void(* NvDsInferContextLoggingFunc)(NvDsInferContextHandle handle, unsigned int uniqueID, NvDsInferLogLevel logLevel, const char *logMessage, void *userCtx)
Type declaration for a logging callback.
#define _DS_DEPRECATED_(STR)
@ NvDsInferNetworkType_Segmentation
Specifies a segmentation network.
void * returnFuncData
A pointer to the data to be supplied with the callback in returnInputFunc.
NvDsInferAttribute * attributes
Holds a pointer to an array of attributes.
char modelFilePath[_PATH_MAX]
Holds the pathname of the caffemodel file.
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...
Holds detection and bounding box grouping parameters.
Holds the information inferred by the network on one frame.
int groupThreshold
Holds the minimum number boxes in a cluster to be considered an object during grouping using OpenCV g...
char ** outputIOFormats
Can be used to specify the format and datatype for bound output layers.
NvDsInferNetworkType
Defines network types.
@ NvDsInferFormat_BGR
Specifies 24-bit interleaved B-G-R format.
NvDsInferDimsCHW inputDims
Holds the input dimensions for the model.
Holds the output for all of the frames in a batch (an array of frame), and related buffer information...
NvDsInferDimsCHW inferInputDims
Inference input dimensions for runtime engine.
char * label
Holds a pointer to a string containing a label for the classified output.
@ NvDsInferNetworkType_Other
Specifies other.
Holds the information about one detected object.
char uffFilePath[_PATH_MAX]
Holds the pathname of the UFF model file.
NvDsInferDetectionOutput detectionOutput
Holds detector output.
Holds information about one classified attribute.
void ** inputFrames
Holds a pointer to an array of pointers to input frame buffers.
float eps
Holds the epsilon to control merging of overlapping boxes.
int topK
Number of objects with objects to be filtered in the decensding order of probability.
char uffInputBlobName[_MAX_STR_LENGTH]
Holds the name of the input layer for the UFF model.
NvDsInferNetworkMode networkMode
Holds an internal data format specifier used by the inference engine.
void * returnFuncData
A pointer to the data to be supplied with the callback in returnInputFunc.
@ NvDsInferFormat_BGRx
Specifies 32-bit interleaved B-G-R-x format.
char modelEngineFilePath[_PATH_MAX]
Holds the pathname of the serialized model engine file.
unsigned int numHostBuffers
Holds the number of elements in hostBuffers.
NvDsInferClusterMode clusterMode
Holds the type of clustering mode.
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.