80 #ifndef __NVDSINFER_CONTEXT_H__
81 #define __NVDSINFER_CONTEXT_H__
93 #define _PATH_MAX 4096
96 #define _MAX_CHANNELS 4
99 #define _MAX_STR_LENGTH 1024
102 #define NVDSINFER_MAX_BATCH_SIZE 1024
105 #define NVDSINFER_MIN_OUTPUT_BUFFERPOOL_SIZE 2
496 const char * logMessage,
void *userCtx);
538 struct INvDsInferContext
586 virtual void fillLayersInfo(std::vector<NvDsInferLayerInfo> &layersInfo) = 0;
603 virtual const std::vector< std::vector<std::string> >& getLabels() = 0;
608 virtual void destroy() = 0;
610 virtual ~INvDsInferContext() {}
626 void *userCtx =
nullptr,
742 unsigned int id,
unsigned int value);
NvDsInferUffInputOrder
Enum for the UFF input layer order.
unsigned int maxBatchSize
Max number of frames that will be inferred together in a batch.
NvDsInferNetworkMode
Enum for internal data format to be used by the inference engine.
NvDsInferStatus NvDsInferContext_QueueInputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchInput *batchInput)
Queue a batch of input frames for pre-processing and inferencing.
void NvDsInferContext_GetNetworkInfo(NvDsInferContextHandle handle, NvDsInferNetworkInfo *networkInfo)
Get the network input information.
Holds the detection and bounding box grouping parameters.
NvDsInferStatus NvDsInferContext_Create(NvDsInferContextHandle *handle, NvDsInferContextInitParams *initParams, void *userCtx, NvDsInferContextLoggingFunc logFunc)
Creates a new instance of the NvDsInferContext class with the supplied initialization parameters...
char modelEngineFilePath[_PATH_MAX]
Path to the serialized model engine file.
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
NvDsInferContext operation succeeded.
void NvDsInferContext_Destroy(NvDsInferContextHandle handle)
Destroy a NvDsInferContext instance and release the associated resources.
NvDsInferNetworkMode networkMode
Internal data format to be used by the inference engine.
char uffInputBlobName[_MAX_STR_LENGTH]
Name of the input layer for the UFF model.
Holds the initialization parameters required for the NvDsInferContext interface.
unsigned int gpuID
ID of the GPU to run the inference on.
TensorRT interface failed.
Invalid parameters were supplied.
Holds information about one classified attribute.
int copyInputToHostBuffers
Boolean indicating if input layer contents should be copied to host memories for access in the applic...
NvDsInferDimsCHW uffDimsCHW
Input dimensions for the UFF model.
NvDsInferFormat
Enum for color formats.
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 cont...
#define _PATH_MAX
Maximum length of a file path parameter.
unsigned int numDetectedClasses
Number of classes detected by a detector network.
unsigned int width
Object width.
void ** inputFrames
Array of pointers to buffers for input frames.
unsigned int numInputFrames
Number of input frames i.e.
A batch is an array of frames.
NvDsInferDetectionParams * perClassDetectionParams
Per class detection parameters.
char meanImageFilePath[_PATH_MAX]
Path to the mean image file (PPM format).
void NvDsInferContext_FillLayersInfo(NvDsInferContextHandle handle, NvDsInferLayerInfo *layersInfo)
Fill the input vector with information on all the bound layers of the inference engine in the NvDsInf...
unsigned int numOutputDeviceBuffers
unsigned int uniqueID
Unique identifier for the instance.
int dlaCore
DLA Core to use.
unsigned int outputBufferPoolSize
Number of sets of output buffers (host and device) to be allocated.
CUDA error was encountered.
char protoFilePath[_PATH_MAX]
Path to the prototxt file.
float segmentationThreshold
NvDsInferNetworkType outputType
Output type indicating the valid member in the union.
unsigned int numOutputLayers
NvDsInferNetworkType networkType
Type of the network.
unsigned int numHostBuffers
NvDsInferContextReturnInputAsyncFunc returnInputFunc
Callback function for returning the input buffers back to the client.
float * class_probability_map
Pointer to the raw array containing the probabilities.
float classifierThreshold
Minimum confidence threshold for classifier to consider a label valid.
char int8CalibrationFilePath[_PATH_MAX]
Path to the INT8 calibration file.
float offsets[_MAX_CHANNELS]
Per channel offsets for mean subtraction.
NVIDIA DeepStream inference specifications
char tltEncodedModelFilePath[_PATH_MAX]
Path to the TLT encoded model file.
#define _MAX_STR_LENGTH
Maximum length of string parameters.
Holds the information about one batch to be inferred.
void(* NvDsInferContextReturnInputAsyncFunc)(void *data)
Callback function type for returning the input client buffers back to the NvDsInferContext client asy...
char ** outputLayerNames
Array of output Layer Names.
Detectors will find objects and their coordinates in the input frame along with the class of the obje...
Holds the information about one detected object.
NvDsInferClassificationOutput classificationOutput
Classifier output.
char onnxFilePath[_PATH_MAX]
Path to the ONNX model file.
NvDsInferUffInputOrder uffInputOrder
Original input order for the UFF model.
Holds the information on all attributes classifed by a classifier network for one frame...
unsigned int numAttributes
Size of the attributes array.
NvDsInferDetectionOutput detectionOutput
Detector output.
NvDsInferFormat networkInputFormat
Network input format.
NvDsInferAttribute * attributes
Array of attributes.
Holds the information parsed from segmentation network output for one frame.
struct INvDsInferContext * NvDsInferContextHandle
An opaque pointer type to be used as an handle for the context instance.
char customNetworkConfigFilePath[_PATH_MAX]
Path to the config file for custom network creation.
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 attribut...
unsigned int height
Height of the output.
char customBBoxParseFuncName[_MAX_STR_LENGTH]
Name of the custom bounding box function in the custom library.
Holds the information on all objects detected by a detector network in one frame. ...
void NvDsInferContext_ResetInitParams(NvDsInferContextInitParams *initParams)
Reset the members of initialization parameters to default values.
#define _MAX_CHANNELS
Maximum number of channels supported by the API for image input layers.
unsigned int height
Object height.
unsigned int left
Offset from the left boundary of the frame.
Failed to configure the NvDsInferContext instance possibly due to an erroneous initialization propert...
Segmentation - will classify each pixel into some finite possible classes.
unsigned int NvDsInferContext_GetNumLayersInfo(NvDsInferContextHandle handle)
Get the number of the bound layers of the inference engine in the NvDsInferContext instance...
32-bit interleaved R-G-B-A
char tltModelKey[_MAX_STR_LENGTH]
String key for decoding the TLT encoded model.
struct _NvDsInferContextInitParams NvDsInferContextInitParams
Holds the initialization parameters required for the NvDsInferContext interface.
unsigned int numObjects
Number of objects in the array.
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
char labelsFilePath[_PATH_MAX]
Path to the labels file containing strings for the class labels.
unsigned int classes
Number of classes supported by the network.
NvDsInferNetworkType
Enum for the type of the network.
char uffFilePath[_PATH_MAX]
Path to the UFF model file.
Unknown error was encountered.
unsigned int inputPitch
Pitch of the input frames, in bytes.
unsigned int width
Width of the output.
char modelFilePath[_PATH_MAX]
Path to the caffemodel file.
NvDsInferObject * objects
Array of objects.
Holds the information inferred by the network on one frame.
unsigned int top
Offset from the top boundary of the frame.
Holds information about the model network.
void ** hostBuffers
Array of pointers to set of host buffers for this batch.
float eps
Epsilon to control merging of overlapping boxes.
NvDsInferSegmentationOutput segmentationOutput
Classifier output.
Specifies dimensions of a layer with 3 dimensions.
char customLibPath[_PATH_MAX]
Path to the library containing custom methods required to support the network.
int useDLA
Boolean indicating if DLA should be used.
const char * NvDsInferContext_GetStatusName(NvDsInferStatus status)
Get the string name for the status.
int useDBScan
Boolean indicating if DBScan should be used for object clustering.
NvDsInferFrameOutput * frames
Array of outputs for each frame in the batch.
Holds information about one layer in the model.
char * label
String label for the classified output.
float threshold
Bounding box detection threshold.
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.
int groupThreshold
Minimum boxes in a cluster to be considered an object during grouping using OpenCV groupRectangles...
int * class_map
Pointer to the array for 2D pixel class map.
Other - Output layers will not be parsed by NvDsInferContext.
Classifiers - will classify the entire frame into some finite possible classes.
NvDsInferFormat inputFormat
Format of the frame contents.
float networkScaleFactor
Normalization factor to scale the input pixels with.
32-bit interleaved B-G-R-x
Custom Library interface implementation failed.
unsigned int outputBatchID
ID for the set of output buffers.
NvDsInferStatus NvDsInferContext_DequeueOutputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput)
Dequeue output for a batch of frames.
void * returnFuncData
Pointer to the data to be supplied with the return NvDsInferContextReturnInputAsyncFunc callback...
int minBoxes
Minimum boxes in a cluster to be considered an object during grouping using DBSCAN.
void ** outputDeviceBuffers
Array of pointers to set of output device buffers for this batch.
char customClassifierParseFuncName[_MAX_STR_LENGTH]
Name of the custom classifier attribute parsing function in the custom library.