|
|
NVIDIA DeepStream SDK API Reference
|
9.0 Release
|
Go to the documentation of this file.
24 #ifndef __POST_PROCESS_STRUCT_HPP__
25 #define __POST_PROCESS_STRUCT_HPP__
30 #include "gstnvdsinfer.h"
37 #define _PATH_MAX 4096
38 #define _MAX_STR_LENGTH 1024
43 #define getDimsCHWFromDims(dimsCHW,dims) \
45 (dimsCHW).c = (dims).d[0]; \
46 (dimsCHW).h = (dims).d[1]; \
47 (dimsCHW).w = (dims).d[2]; \
50 #define getDimsHWCFromDims(dimsCHW,dims) \
52 (dimsCHW).h = (dims).d[0]; \
53 (dimsCHW).w = (dims).d[1]; \
54 (dimsCHW).c = (dims).d[2]; \
57 #define DIVIDE_AND_ROUND_UP(a, b) ((a + b - 1) / b)
59 inline const char *
safeStr(
const std::string &str)
65 return !str || strlen(str) == 0;
112 #define printMsg(level, tag_str, fmt, ...) \
114 char* baseName = strrchr((char*)__FILE__, '/'); \
115 baseName = (baseName) ? (baseName + 1) : (char*)__FILE__; \
116 char logMsgBuffer[5 * _MAX_STR_LENGTH + 1]; \
117 snprintf(logMsgBuffer, 5 * _MAX_STR_LENGTH, \
118 tag_str " NvDsPostProcess::%s() <%s:%d> : " fmt, \
119 __func__, baseName, __LINE__, ##__VA_ARGS__); \
120 fprintf(stderr, "%s\n", logMsgBuffer); \
123 #define printError(fmt, ...) \
125 printMsg (NVDSINFER_LOG_ERROR, "Error in", fmt, ##__VA_ARGS__); \
128 #define printWarning(fmt, ...) \
130 printMsg (NVDSINFER_LOG_WARNING, "Warning from", fmt, ##__VA_ARGS__); \
133 #define printInfo(fmt, ...) \
135 printMsg (NVDSINFER_LOG_INFO, "Info from", fmt, ##__VA_ARGS__); \
138 #define printDebug(fmt, ...) \
140 printMsg (NVDSINFER_LOG_DEBUG, "DEBUG", fmt, ##__VA_ARGS__); \
596 if (attr.attributeLabel)
597 free (attr.attributeLabel);
Holds information about one detected object.
NvDsPostProcessClusterMode clusterMode
Holds the type of clustering mode.
unsigned int numFrames
Holds the number of elements in frames.
std::string label
Cached string label.
char * label
Holds a pointer to a string containing a label for the classified output.
unsigned int numOutputDeviceBuffers
Holds the number of elements in *outputDeviceBuffers.
struct _NvDsPostProcessContextInitParams NvDsPostProcessContextInitParams
Holds the initialization parameters required for the NvDsPostProcessContext interface.
Holds the box parameters of the box to be overlayed.
@ NvDsPostProcessNetworkType_Segmentation
Specifies a segmentation network.
NvOSD_ColorParams bg_color
Holds information about one parsed object from a detector's output.
@ NVDSPOSTPROCESS_OUTPUT_PARSING_FAILED
Output parsing failed.
unsigned int classId
Holds the ID of the class to which the object belongs.
float classifierThreshold
Holds the minimum confidence threshold for the classifier to consider a label valid.
~NvDsPostProcessObjectInfo()
NvDsInferDimsCHW inferInputDims
Inference input dimensions for runtime engine.
std::vector< float > perClassPreclusterThreshold
Holds a per-class vector of detection confidence thresholds to be applied prior to the clustering ope...
unsigned int detectionMinHeight
@ NVDSPOSTPROCESS_CUDA_ERROR
CUDA error was encountered.
Holds information about one classified attribute.
float height
Holds the height of the object's bounding box.
void ** hostBuffers
Holds a pointer to an array of pointers to host buffers for this batch.
float left
Holds the horizontal offset of the bounding box shape for the object.
NvDsPostProcessObjectDetectionInfo NvDsPostProcessParseObjectInfo
A typedef defined to maintain backward compatibility.
Holds detection and bounding box grouping parameters.
unsigned int roiBottomOffset
@ NvDsPostProcessNetworkType_Classifier
Specifies a classifier.
@ NVDSPOSTPROCESS_SUCCESS
operation succeeded.
int under_inference
Boolean indicating if the object is already being inferred on.
NvDsPostProcessColorParams color_params
float detectionConfidence
Holds the object detection confidence level; must in the range [0.0,1.0].
@ NVDSPOSTPROCESS_CLUSTER_DBSCAN_NMS_HYBRID
unsigned int width
Holds the width of the output.
char customBBoxParseFuncName[_MAX_STR_LENGTH]
Holds the name of the custom bounding box function in the custom library.
unsigned int attributeValue
Holds the the attribute's output value.
@ NVDSPOSTPROCESS_CLUSTER_DBSCAN
unsigned int mask_width
Holds width of mask.
unsigned int detectionMaxHeight
unsigned int detectionMaxHeight
@ NVDSPOSTPROCESS_INVALID_PARAMS
Invalid parameters were supplied.
int classIndex
Holds the index for the object's class.
float * class_probability_map
Holds a pointer to an array containing raw probabilities.
constexpr int PROCESS_MODEL_FULL_FRAME
float top
Holds the object's offset from the top boundary of the frame.
float width
Holds the width of the object's bounding box.
float eps
Holds the epsilon to control merging of overlapping boxes.
unsigned int numDetectedClasses
Holds the number of classes detected by a detector network.
NvDsPostProcessClusterMode
Enum for clustering mode for detectors.
constexpr int PROCESS_MODEL_OBJECTS
NvDsPostProcessBodyPoseOutput bodyPoseOutput
Holds classifier output.
NvDsPostProcessObjectInfo cached_info
Cached object information.
Holds the cached information of an object.
NvDsPostProcessNetworkType
Defines network types.
constexpr float DEFAULT_POST_CLUSTER_THRESHOLD
constexpr bool ATHR_ENABLED
unsigned int detectionMinWidth
unsigned int uniqueID
Holds a unique identifier for the instance.
@ NvDsPostProcessTensorOrder_kNHWC
Holds information on all objects detected by a detector network in one frame.
NvDsPostProcessStatus
Enum for the status codes returned by NvDsPostProcessAlgorithm.
float top
Holds the vertical offset of the object's bounding box.
@ NvDsPostProcessNetworkType_BodyPose
Bodypose 3D.
@ NvDsPostProcessTensorOrder_kNC
unsigned int mask_height
Holds height of mask.
Holds information about one parsed object and instance mask from a detector's output.
unsigned int detectionMinWidth
@ NVDSPOSTPROCESS_UNKNOWN_ERROR
Unknown error was encountered.
Holds the bounding box coloring information for one class;.
NvDsPostProcessTensorOrder
Defines UFF layer orders.
float nmsIOUThreshold
IOU threshold to be used with NMS mode of clustering.
@ NVDSPOSTPROCESS_CLUSTER_NONE
unsigned int numHostBuffers
Holds the number of elements in hostBuffers.
NvDsPostProcessFrameOutput * frames
Holds a pointer to an array of outputs for each frame in the batch.
NvDsPostProcessDetectionParams * perClassDetectionParams
Holds per-class detection parameters.
float top
Holds the vertical offset of the object's bounding box.
unsigned long last_inferred_frame_num
Number of the frame in the stream when the object was last inferred on.
float detectionConfidence
Holds the object detection confidence level; must in the range [0.0,1.0].
constexpr float DEFAULT_EPS
constexpr float DEFAULT_DBSCAN_MIN_SCORE
float attributeConfidence
Holds the attribute's confidence level.
@ NvDsPostProcessNetworkType_InstanceSegmentation
Specifies a instance segmentation network.
float segmentationThreshold
unsigned int height
Holds the height of the output.
unsigned int gpuID
Holds the ID of the GPU which is to run the inference.
NvDsPostProcessNetworkType outputType
Holds an output type indicating the valid member in the union of detectionOutput, classificationOutpu...
char customClassifierParseFuncName[_MAX_STR_LENGTH]
Name of the custom classifier attribute parsing function in the custom library.
float postClusterThreshold
Hold the bounding box detection threshold to be applied post clustering operation.
float width
Holds the width of the object's bounding box.
unsigned long last_accessed_frame_num
Number of the frame in the stream when the object was last accessed.
@ NvDsPostProcessNetworkType_Detector
Specifies a detector.
Holds the initialization parameters required for the NvDsPostProcessContext interface.
@ NVDSPOSTPROCESS_LOG_INFO
constexpr float DEFAULT_PRE_CLUSTER_THRESHOLD
@ NVDSPOSTPROCESS_CONFIG_FAILED
Failed to configure the instance possibly due to an erroneous initialization property.
unsigned int roiTopOffset
float left
Holds the horizontal offset of the bounding box shape for the object.
Holds the information inferred by the network on one frame.
@ NVDSPOSTPROCESS_LOG_DEBUG
unsigned int mask_size
Holds size of mask in bytes.
unsigned int num_key_points
char * attributeLabel
Holds a pointer to a string containing the attribute's label.
constexpr int DEFAULT_MIN_BOXES
void * priv
Holds a private context pointer for the set of output buffers.
@ NVDSPOSTPROCESS_CLUSTER_GROUP_RECTANGLES
Holds the dimensions of a three-dimensional layer.
NvDsPostProcessNetworkType networkType
Holds the network type.
unsigned int numObjects
Holds the number of objects in objects.
std::vector< NvDsPostProcessAttribute > attributes
Vector of cached classification attributes.
float preClusterThreshold
Holds the bounding box detection threshold to be applied prior to clustering operation.
unsigned int detectionMaxWidth
constexpr int DEFAULT_TOP_K
char * label
Holds a pointer to a string containing a label for the object.
const char * safeStr(const std::string &str)
NvDsPostProcessTensorOrder segmentationOutputOrder
Holds output order for segmentation network.
Holds information parsed from segmentation network output for one frame.
unsigned int mask_size
Holds size of mask in bytes.
int * class_map
Holds a pointer to an array for the 2D pixel class map.
struct NvDsPoint3f NvDsPoint3f
Holds the output for all of the frames in a batch (an array of frame), and related buffer information...
Holds information parsed from bodypose network output for one frame.
void ** outputDeviceBuffers
Holds a pointer to an array of pointers to output device buffers for this batch.
char customBBoxInstanceMaskParseFuncName[_MAX_STR_LENGTH]
Holds the name of the bounding box and instance mask parse function in the custom library.
int groupThreshold
Holds the minimum number boxes in a cluster to be considered an object during grouping using OpenCV g...
constexpr float DEFAULT_NMS_IOU_THRESHOLD
@ NVDSPOSTPROCESS_CUSTOM_LIB_FAILED
Custom Library interface implementation failed.
unsigned int numAttributes
Holds the size of the attributes array.
unsigned int detectionMaxWidth
unsigned int mask_height
Holds height of mask.
unsigned int roiBottomOffset
char labelsFilePath[_PATH_MAX]
Holds the pathname of the labels file containing strings for the class labels.
unsigned int maxBatchSize
Holds the maximum number of frames to be inferred together in a batch.
NvDsPostProcessObject * objects
Holds a pointer to an array of objects.
char ** outputLayerNames
Holds a pointer to an array of pointers to output layer names.
gboolean preprocessor_support
Holds boolean value to show whether preprocessor support is there.
struct _NvDsPostProcessObjectHistory NvDsPostProcessObjectHistory
Holds the inference information/history for one object based on it's tracking id.
constexpr float ATHR_THRESHOLD
unsigned int mask_width
Holds width of mask.
unsigned int height
Holds the height of the output.
NvDsPostProcessClassificationOutput classificationOutput
Holds classifier output.
Holds the color parameters of the box or text to be overlayed.
NvOSD_ColorParams border_color
@ NVDSPOSTPROCESS_LOG_ERROR
Holds the inference information/history for one object based on it's tracking id.
float * mask
Holds object segment mask.
float height
Holds the object's height.
@ NVDSPOSTPROCESS_RESOURCE_ERROR
Resource error was encountered.
int minBoxes
Holds the minimum number of boxes in a cluster to be considered an object during grouping using DBSCA...
NvDsPostProcessSegmentationOutput segmentationOutput
Holds classifier output.
unsigned int detectionMinHeight
@ NvDsPostProcessNetworkType_Other
Specifies other.
unsigned int attributeIndex
Holds the index of the attribute's label.
unsigned int roiTopOffset
float left
Holds the object's offset from the left boundary of the frame.
int topK
Number of objects with objects to be filtered in the decensding order of probability.
constexpr int DEFAULT_GROUP_THRESHOLD
Holds information on all attributes classifed by a classifier network for one frame.
@ NVDSPOSTPROCESS_LOG_WARNING
float minScore
Minimum score in a cluster for the cluster to be considered an object during grouping.
float height
Holds the height of the object's bounding box.
NvDsPostProcessObjectInfo()=default
bool string_empty(const char *str)
NvDsPostProcessDetectionOutput detectionOutput
Holds detector output.
unsigned int numClassesConfigured
Holds the number of classes requested to be parsed, starting with class ID 0.
NvDsPostProcessAttribute * attributes
Holds a pointer to an array of attributes.
unsigned int classId
Holds the ID of the class to which the object belongs.
unsigned int width
Holds the width of the output.
unsigned int numOutputLayers
Holds the number of output layer names.
@ NVDSPOSTPROCESS_CLUSTER_NMS
unsigned int classes
Holds the number of classes supported by the network.
Holds the detection parameters required for parsing objects.
NvOSD_RectParams last_inferred_coords
Bounding box co-ordinates of the object when it was last inferred on.
@ NvDsPostProcessTensorOrder_kNCHW
float width
Holds the object's width.
std::vector< float > perClassPostclusterThreshold