_NvDsInferContextInitParams

struct _NvDsInferContextInitParams

Holds the initialization parameters required for the NvDsInferContext interface.

Public Members

unsigned int uniqueID

Holds a unique identifier for the instance.

This can be used to identify the instance that is generating log and error messages.

NvDsInferNetworkMode networkMode

Holds an internal data format specifier used by the inference engine.

char protoFilePath[_PATH_MAX]

Holds the pathname of the prototxt file.

char modelFilePath[_PATH_MAX]

Holds the pathname of the caffemodel file.

char uffFilePath[_PATH_MAX]

Holds the pathname of the UFF model file.

char onnxFilePath[_PATH_MAX]

Holds the pathname of the ONNX model file.

char tltEncodedModelFilePath[_PATH_MAX]

Holds the pathname of the TLT encoded model file.

char int8CalibrationFilePath[_PATH_MAX]

Holds the pathname of the INT8 calibration file.

Required only when using INT8 mode.

NvDsInferDimsCHW inputDims

Holds the input dimensions for the model.

NvDsInferDimsCHW uffDimsCHW

Holds the input dimensions for the UFF model.

NvDsInferTensorOrder uffInputOrder

Holds the original input order for the UFF model.

char uffInputBlobName[_MAX_STR_LENGTH]

Holds the name of the input layer for the UFF model.

char tltModelKey[_MAX_STR_LENGTH]

Holds the string key for decoding the TLT encoded model.

char modelEngineFilePath[_PATH_MAX]

Holds the pathname of the serialized model engine file.

When using the model engine file, other parameters required for creating the model engine are ignored.

unsigned int maxBatchSize

Holds the maximum number of frames to be inferred together in a batch.

The number of input frames in a batch must be less than or equal to this.

char labelsFilePath[_PATH_MAX]

Holds the pathname of the labels file containing strings for the class labels.

The labels file is optional. The file format is described in the custom models section of the DeepStream SDK documentation.

char meanImageFilePath[_PATH_MAX]

Holds the pathname of the mean image file (PPM format).

File resolution must be equal to the network input resolution.

float networkScaleFactor

Holds the normalization factor with which to scale the input pixels.

NvDsInferFormat networkInputFormat

Holds the network input format.

float offsets[_MAX_CHANNELS]

Holds the per-channel offsets for mean subtraction.

This is an alternative to the mean image file. The number of offsets in the array must be equal to the number of input channels.

NvDsInferNetworkType networkType

Holds the network type.

Use NvDsInferClusterMode instead int useDBScan

Holds a Boolean; true if DBScan is to be used for object clustering, or false if OpenCV groupRectangles is to be used.

unsigned int numDetectedClasses

Holds the number of classes detected by a detector network.

NvDsInferDetectionParams *perClassDetectionParams

Holds per-class detection parameters.

The array’s size must be equal to numDetectedClasses.

float classifierThreshold

Holds the minimum confidence threshold for the classifier to consider a label valid.

char **outputLayerNames

Holds a pointer to an array of pointers to output layer names.

unsigned int numOutputLayers

Holds the number of output layer names.

char customLibPath[_PATH_MAX]

Holds the pathname of the library containing custom methods required to support the network.

char customBBoxParseFuncName[_MAX_STR_LENGTH]

Holds the name of the custom bounding box function in the custom library.

char customClassifierParseFuncName[_MAX_STR_LENGTH]

Name of the custom classifier attribute parsing function in the custom library.

int copyInputToHostBuffers

Holds a Boolean; true if the input layer contents are to be copied to host memory for access by the application.

unsigned int gpuID

Holds the ID of the GPU which is to run the inference.

int useDLA

Holds a Boolean; true if DLA is to be used.

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.

char customNetworkConfigFilePath[_PATH_MAX]

Holds the pathname of the configuration file for custom network creation.

This can be used to store custom properties required by the custom network creation function.

char customEngineCreateFuncName[_MAX_STR_LENGTH]

Name of the custom engine creation function in the custom library.

int forceImplicitBatchDimension

For model parsers supporting both implicit batch dim and full dims, prefer to use implicit batch dim.

By default, full dims network mode is used.

unsigned int workspaceSize

Max workspace size (unit MB) that will be used as tensorrt build settings for cuda engine.

NvDsInferDimsCHW inferInputDims

Inference input dimensions for runtime engine.

NvDsInferClusterMode clusterMode

Holds the type of clustering mode.

char customBBoxInstanceMaskParseFuncName[_MAX_STR_LENGTH]

Holds the name of the bounding box and instance mask parse function in the custom library.

char **outputIOFormats

Can be used to specify the format and datatype for bound output layers.

For each layer specified the format is “<layer-name>:<data-type>:<format>”

unsigned int numOutputIOFormats

Holds number of output IO formats specified.

char **layerDevicePrecisions

Can be used to specify the device type and inference precision of layers.

For each layer specified the format is “<layer-name>:<device-type>:<precision>”

unsigned int numLayerDevicePrecisions

Holds number of layer device precisions specified.