65 #ifndef __NVDSINFER_CONTEXT_H__
66 #define __NVDSINFER_CONTEXT_H__
78 #define _PATH_MAX 4096
81 #define _MAX_CHANNELS 4
84 #define _MAX_STR_LENGTH 1024
87 #define NVDSINFER_MAX_BATCH_SIZE 1024
90 #define NVDSINFER_MIN_OUTPUT_BUFFERPOOL_SIZE 2
481 const char * logMessage,
void *userCtx);
523 struct INvDsInferContext
571 virtual void fillLayersInfo(std::vector<NvDsInferLayerInfo> &layersInfo) = 0;
588 virtual const std::vector< std::vector<std::string> >& getLabels() = 0;
593 virtual void destroy() = 0;
595 virtual ~INvDsInferContext() {}
611 void *userCtx =
nullptr,
727 unsigned int id,
unsigned int value);
unsigned int maxBatchSize
Max number of frames that will be inferred together in a batch.
Failed to configure the NvDsInferContext instance possibly due to an erroneous initialization propert...
Holds the detection and bounding box grouping parameters.
char modelEngineFilePath[_PATH_MAX]
Path to the serialized model engine file.
#define _MAX_CHANNELS
Maximum number of channels supported by the API for image input layers.
NvDsInferNetworkMode networkMode
Internal data format to be used by the inference engine.
TensorRT interface failed.
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.
NvDsInferContext operation succeeded.
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.
NvDsInferStatus NvDsInferContext_QueueInputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchInput *batchInput)
Queue a batch of input frames for pre-processing and inferencing.
unsigned int numDetectedClasses
Number of classes detected by a detector network.
unsigned int width
Object width.
32-bit interleaved B-G-R-x
void ** inputFrames
Array of pointers to buffers for input frames.
unsigned int NvDsInferContext_GetNumLayersInfo(NvDsInferContextHandle handle)
Get the number of the bound layers of the inference engine in the NvDsInferContext instance...
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).
NvDsInferLogLevel
Enum for the log levels of NvDsInferContext.
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.
char protoFilePath[_PATH_MAX]
Path to the prototxt file.
struct INvDsInferContext * NvDsInferContextHandle
An opaque pointer type to be used as an handle for the context instance.
float segmentationThreshold
NvDsInferNetworkType outputType
Output type indicating the valid member in the union.
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 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.
Other - Output layers will not be parsed by NvDsInferContext.
Copyright (c) 2017-2019, NVIDIA CORPORATION.
char tltEncodedModelFilePath[_PATH_MAX]
Path to the TLT encoded model file.
Holds the information about one batch to be inferred.
NvDsInferNetworkType
Enum for the type of the network.
char ** outputLayerNames
Array of output Layer Names.
Holds the information about one detected object.
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...
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.
Detectors will find objects and their coordinates in the input frame along with the class of the obje...
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.
NvDsInferStatus NvDsInferContext_DequeueOutputBatch(NvDsInferContextHandle handle, NvDsInferContextBatchOutput *batchOutput)
Dequeue output for a batch of frames.
const char * NvDsInferContext_GetStatusName(NvDsInferStatus status)
Get the string name for the status.
char customNetworkConfigFilePath[_PATH_MAX]
Path to the config file for custom network creation.
unsigned int height
Height of the output.
char customBBoxParseFuncName[_MAX_STR_LENGTH]
Name of the custom bounding box function in the custom library.
NvDsInferStatus NvDsInferContext_Create(NvDsInferContextHandle *handle, NvDsInferContextInitParams *initParams, void *userCtx, NvDsInferContextLoggingFunc logFunc)
Creates a new instance of the NvDsInferContext class with the supplied initialization parameters...
Holds the information on all objects detected by a detector network in one frame. ...
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.
Segmentation - will classify each pixel into some finite possible classes.
unsigned int height
Object height.
unsigned int left
Offset from the left boundary of the frame.
char tltModelKey[_MAX_STR_LENGTH]
String key for decoding the TLT encoded model.
Classifiers - will classify the entire frame into some finite possible classes.
unsigned int numObjects
Number of objects in the array.
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...
32-bit interleaved R-G-B-A
NvDsInferUffInputOrder
Enum for the UFF input layer order.
char labelsFilePath[_PATH_MAX]
Path to the labels file containing strings for the class labels.
void NvDsInferContext_GetNetworkInfo(NvDsInferContextHandle handle, NvDsInferNetworkInfo *networkInfo)
Get the network input information.
unsigned int classes
Number of classes supported by the network.
#define _MAX_STR_LENGTH
Maximum length of string parameters.
Custom Library interface implementation failed.
char uffFilePath[_PATH_MAX]
Path to the UFF model file.
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.
Unknown error was encountered.
Holds the information inferred by the network on one frame.
unsigned int top
Offset from the top boundary of the frame.
Invalid parameters were supplied.
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.
void(* NvDsInferContextReturnInputAsyncFunc)(void *data)
Callback function type for returning the input client buffers back to the NvDsInferContext client asy...
NvDsInferSegmentationOutput segmentationOutput
Classifier output.
Specifies dimensions of a layer with 3 dimensions.
struct _NvDsInferContextInitParams NvDsInferContextInitParams
Holds the initialization parameters required for the NvDsInferContext interface.
char customLibPath[_PATH_MAX]
Path to the library containing custom methods required to support the network.
#define _PATH_MAX
Maximum length of a file path parameter.
int useDLA
Boolean indicating if DLA should be used.
int useDBScan
Boolean indicating if DBScan should be used for object clustering.
NvDsInferFrameOutput * frames
Array of outputs for each frame in the batch.
NvDsInferNetworkMode
Enum for internal data format to be used by the inference engine.
void NvDsInferContext_Destroy(NvDsInferContextHandle handle)
Destroy a NvDsInferContext instance and release the associated resources.
Holds information about one layer in the model.
char * label
String label for the classified output.
float threshold
Bounding box detection threshold.
int groupThreshold
Minimum boxes in a cluster to be considered an object during grouping using OpenCV groupRectangles...
NvDsInferStatus
Enum for the status codes returned by NvDsInferContext.
int * class_map
Pointer to the array for 2D pixel class map.
NvDsInferFormat inputFormat
Format of the frame contents.
float networkScaleFactor
Normalization factor to scale the input pixels with.
void NvDsInferContext_ResetInitParams(NvDsInferContextInitParams *initParams)
Reset the members of initialization parameters to default values.
unsigned int outputBatchID
ID for the set of output buffers.
CUDA error was encountered.
void * returnFuncData
Pointer to the data to be supplied with the return NvDsInferContextReturnInputAsyncFunc callback...
NvDsInferFormat
Enum for color formats.
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.