Data Structures | |
class | GstNvInferServerImpl |
Class of the nvinferserver element implementation. More... | |
struct | GstNvInferServerObjectHistory |
Holds the inference information/history for one object based on its tracking ID. More... | |
struct | GstNvInferServerProperties |
Holds the configuration information from the nvinferserver element properties. More... | |
struct | GstNvInferServerSourceInfo |
Holds information about the detected objects in the specific input source. More... | |
Typedefs | |
using | SharedObjHistory = std::shared_ptr< GstNvInferServerObjectHistory > |
using | WeakObjHistory = std::weak_ptr< GstNvInferServerObjectHistory > |
typedef std::unordered_map< uint64_t, SharedObjHistory > | GstNvInferServerObjectHistoryMap |
Map for maintaining inference history for objects based on their tracking ids: Object ID : Object History. More... | |
using | RawOutputCallback = std::function< void(void *, NvDsInferNetworkInfo &, NvDsInferLayerInfo *, uint32_t, uint32_t)> |
Function for raw output callback . More... | |
Functions | |
void | attachDetectionMetadata (NvDsFrameMeta *frameMeta, NvDsObjectMeta *parentObj, const NvDsInferDetectionOutput &detection_output, float scaleX, float scaleY, uint32_t offsetLeft, uint32_t offsetTop, uint32_t roiLeft, uint32_t roiTop, uint32_t roiWidth, uint32_t roiHeight, uint32_t imageWidth, uint32_t imageHeight, uint32_t uniqueId, const ic::PluginControl &config) |
Attach detection metadata for the objects in a frame. More... | |
void | attachClassificationMetadata (NvDsObjectMeta *objMeta, NvDsFrameMeta *frameMeta, NvDsRoiMeta *roiMeta, const InferClassificationOutput &objInfo, uint32_t uniqueId, const std::string &classifierType, uint32_t imageWidth, uint32_t imageHeight) |
Attach the classification output as NvDsClassifierMeta. More... | |
void | mergeClassificationOutput (InferClassificationOutput &cache, const InferClassificationOutput &newRes) |
Merge the object history with the new classification result. More... | |
void | attachSegmentationMetadata (NvDsObjectMeta *objMeta, NvDsFrameMeta *frameMeta, NvDsRoiMeta *roiMeta, const NvDsInferSegmentationOutput &segmentation_output, dsis::SharedIBatchBuffer &buf) |
Attach the segmentation output as user metadata. More... | |
void | attachTensorOutputMeta (NvDsObjectMeta *objMeta, NvDsFrameMeta *frameMeta, NvDsRoiMeta *roiMeta, uint32_t uniqueId, const std::vector< dsis::SharedIBatchBuffer > &tensors, uint32_t batchIdx, const NvDsInferNetworkInfo &inputInfo, bool maintainAspectRatio) |
Attaches the raw tensor output to the GstBuffer as metadata. More... | |
void | attachFullTensorOutputMeta (NvDsBatchMeta *batchMeta, uint32_t uniqueId, const std::vector< dsis::SharedIBatchBuffer > &tensors, const NvDsInferNetworkInfo &inputInfo) |
Attach the full inference output tensors to the batch metadata. More... | |
typedef std::unordered_map<uint64_t, SharedObjHistory> gstnvinferserver::GstNvInferServerObjectHistoryMap |
Map for maintaining inference history for objects based on their tracking ids: Object ID : Object History.
Definition at line 97 of file gstnvinferserver_impl.h.
using gstnvinferserver::RawOutputCallback = typedef std::function<void(void *, NvDsInferNetworkInfo&, NvDsInferLayerInfo*, uint32_t, uint32_t)> |
Function for raw output callback .
Function for raw output callback (void *gstBuf, NvDsInferNetworkInfo *network_info, NvDsInferLayerInfo *layers_info, uint32_t num_layers, uint32_t batch_size)
Definition at line 135 of file gstnvinferserver_impl.h.
using gstnvinferserver::SharedObjHistory = typedef std::shared_ptr<GstNvInferServerObjectHistory> |
Definition at line 90 of file gstnvinferserver_impl.h.
using gstnvinferserver::WeakObjHistory = typedef std::weak_ptr<GstNvInferServerObjectHistory> |
Definition at line 91 of file gstnvinferserver_impl.h.
void gstnvinferserver::attachClassificationMetadata | ( | NvDsObjectMeta * | objMeta, |
NvDsFrameMeta * | frameMeta, | ||
NvDsRoiMeta * | roiMeta, | ||
const InferClassificationOutput & | objInfo, | ||
uint32_t | uniqueId, | ||
const std::string & | classifierType, | ||
uint32_t | imageWidth, | ||
uint32_t | imageHeight | ||
) |
Attach the classification output as NvDsClassifierMeta.
This functions creates a new metadata of the type NvDsClassifierMeta and attaches it to the object metadata or ROI metadata. If processing on full frames, a new object metadata is created and attached. The display text for the object metadata is updated base on the label in the classification result.
[in,out] | objMeta | Pointer to the object metadata of the inference input. |
[in,out] | frameMeta | Pointer to the frame metadata of the inference input. |
[in,out] | roiMeta | Pointer to the ROI metadata for the inference input. |
[in] | objInfo | The classification output from the inference context. |
[in] | uniqueId | Unique ID of the GIE instance. |
[in] | classifierType | The classifier type of the nvinferserver element. |
[in] | imageWidth | The frame width used as bounding box size when inferencing on full frames. |
[in] | imageHeight | The frame height used as bounding box size when inferencing on full frames. |
void gstnvinferserver::attachDetectionMetadata | ( | NvDsFrameMeta * | frameMeta, |
NvDsObjectMeta * | parentObj, | ||
const NvDsInferDetectionOutput & | detection_output, | ||
float | scaleX, | ||
float | scaleY, | ||
uint32_t | offsetLeft, | ||
uint32_t | offsetTop, | ||
uint32_t | roiLeft, | ||
uint32_t | roiTop, | ||
uint32_t | roiWidth, | ||
uint32_t | roiHeight, | ||
uint32_t | imageWidth, | ||
uint32_t | imageHeight, | ||
uint32_t | uniqueId, | ||
const ic::PluginControl & | config | ||
) |
Attach detection metadata for the objects in a frame.
This function attaches metadata for the objects detected in a frame. It adds a new object metadata, NvDsObjectMeta, to the metadata of the input frame. The bounding box parameters of the detected objects are scaled and shifted as per the actual frame dimensions using the provided scale and offset values.
[in,out] | frameMeta | Pointer to the NvDSFrameMeta structure for the frame. |
[in] | parentObj | Pointer to the NvDsObjMeta structure for the parent object under inference. It is NULL in case of primary detector. |
[in] | detection_output | The detection output from the inference context. |
[in] | scaleX | Horizontal scaling ratio that was applied to the input to get network input dimensions. |
[in] | scaleY | vertical scaling ratio that was applied to the input to get network input dimensions. |
[in] | offsetLeft | Left offset corresponding to the left padding applied to the scaled input. |
[in] | offsetTop | Top offset corresponding to the top padding added to the scaled input. |
[in] | roiLeft | Left pixel coordinate of the input ROI in the parent frame. |
[in] | roiTop | Top pixel coordinate of the input ROI in the parent frame. |
[in] | roiWidth | Width of the ROI in the parent frame. |
[in] | roiHeight | Height of the ROI in the parent frame. |
[in] | imageWidth | Width of the frames in the input batch buffer. |
[in] | imageHeight | Height of the frames in the input batch buffer. |
[in] | uniqueId | Unique ID of the GIE instance. |
[in] | config | The configuration settings used for the GStreamer element. |
void gstnvinferserver::attachFullTensorOutputMeta | ( | NvDsBatchMeta * | batchMeta, |
uint32_t | uniqueId, | ||
const std::vector< dsis::SharedIBatchBuffer > & | tensors, | ||
const NvDsInferNetworkInfo & | inputInfo | ||
) |
Attach the full inference output tensors to the batch metadata.
This functions attaches the output tensors for the entire batch as a user metadata of type NVDSINFER_TENSOR_OUTPUT_META.
[in,out] | batchMeta | Pointer to the bach metadata of the inference input. |
[in] | uniqueId | Unique ID of the GIE instance. |
[in] | tensors | The batch buffer array of the output tensors. |
[in] | inputInfo | Dimensions of the input layer for the network. |
void gstnvinferserver::attachSegmentationMetadata | ( | NvDsObjectMeta * | objMeta, |
NvDsFrameMeta * | frameMeta, | ||
NvDsRoiMeta * | roiMeta, | ||
const NvDsInferSegmentationOutput & | segmentation_output, | ||
dsis::SharedIBatchBuffer & | buf | ||
) |
Attach the segmentation output as user metadata.
This function adds the segmentation output as user metadata of the input buffer. The function adds the user metadata to the ROI metadata if present. Otherwise, if object metadata is present, the user data is added to object metadata. Otherwise it is added to the frame metadata.
[in,out] | objMeta | Pointer to the object metadata of the inference input. |
[in,out] | frameMeta | Pointer to the frame metadata of the inference input. |
[in,out] | roiMeta | Pointer to the ROI metadata for the inference input. |
[in] | segmentation_output | The segmentation output from the inference context. |
[in] | buf | Pointer to the batch buffer containing the segmentation output. This is saved as the priv_data in the user metadata. |
void gstnvinferserver::attachTensorOutputMeta | ( | NvDsObjectMeta * | objMeta, |
NvDsFrameMeta * | frameMeta, | ||
NvDsRoiMeta * | roiMeta, | ||
uint32_t | uniqueId, | ||
const std::vector< dsis::SharedIBatchBuffer > & | tensors, | ||
uint32_t | batchIdx, | ||
const NvDsInferNetworkInfo & | inputInfo, | ||
bool | maintainAspectRatio | ||
) |
Attaches the raw tensor output to the GstBuffer as metadata.
This function attaches the output tensors for each frame in the input batch to the correspoinding ROI metadata or or object metadata or frame metadata.
[in,out] | objMeta | Pointer to the object metadata of the inference input. |
[in,out] | frameMeta | Pointer to the frame metadata of the inference input. |
[in,out] | roiMeta | Pointer to the ROI metadata for the inference input. |
[in] | uniqueId | Unique ID of the GIE instance. |
[in] | tensors | The batch buffer array of the output tensors. |
[in] | batchIdx | Index of the frame within the inference batch. |
[in] | inputInfo | Dimensions of the input layer for the network. |
[in] | maintainAspectRatio | maintain_aspect_ratio configuration setting value. |
void gstnvinferserver::mergeClassificationOutput | ( | InferClassificationOutput & | cache, |
const InferClassificationOutput & | newRes | ||
) |
Merge the object history with the new classification result.
Given an object history, merge the new classification results with the previous cached results. This can be used to improve the results of classification when re-inferencing over time. Currently, the function just uses the latest results.
[in,out] | cache | The cached classification output in the object history. |
[in] | newRes | New classification output for the object. |