Back to Tensorrt

generateDetection Plugin [DEPRECATED]

plugin/generateDetectionPlugin/README.md

23.083.5 KB
Original Source

generateDetection Plugin [DEPRECATED]

This plugin is deprecated since TensorRT 10.12 and will be removed in a future release. No alternatives are planned to be provided.

Table Of Contents

Description

The generateDetection plugin performs bounding boxe refinement of MaskRCNN's detection head and generates the final detection output of MaskRCNN.

Structure

This plugin supports the NCHW format. It takes three input tensors: delta_bbox, score and roi

delta_bbox is the refinement information of roi boxes generated from the MultilevelProposeROI plugin. delta_bbox tensor's shape is [N, rois, num_classes*4, 1, 1] where N is batch size, rois is the total number of ROI boxes candidates per image, and num_classes*4 means 4 refinement elements ([dy, dx, dh, dw]) for each roi box as different classes.

score is the predicted class scores of ROI boxes generated from MaskRCNN detection head of shape [N, rois, num_classes, 1, 1]. There is an argmax operation in generateDetection to determine the final class of detection candidates.

roi is the coordinates of ROI boxes candidates from the MultilevelProposeROI plugin of shape [N, rois, 4].

This plugin generates output of shape [N, keep_topk, 6] where keep_topk is the maximum number of detections left after NMS and '6' means 6 elements of an detection [y1, x1, y2, x2, class_label, score]

Parameters

This plugin has the plugin creator class generateDetectionPluginCreator and the plugin class generateDetection.

The following parameters were used to create generateDetection instance:

TypeParameterDescription
intnum_classesNumber of detection classes(including background). num_classes=91 for COCO dataset
intkeep_topkNumber of detections will be kept after NMS.
floatscore_thresholdConfidence threshold value. This plugin will drop a detection if its class confidence(score) is under "score_threshold".
floatiou_thresholdIOU threshold value used in NMS.
int[3]image_sizeInput image size in CHW. Defaults to [3,832,1344]

Limitations

The number of anchors is capped at 2048 to support embedded devices with smaller shared memory capacity.

To enable support for a device with higher memory, calls to sortPerClass and KeepTopKGather can be modified in DetectionPostProcess (maskRCNNKernels.cu).

Additional resources

License

For terms and conditions for use, reproduction, and distribution, see the TensorRT Software License Agreement documentation.

Changelog

May 2025 Add deprecation note.

January 2022: The Limitations section was added to this README.md file to document limitations of the plugin related to the maximum number of anchors it can support.

June 2020: First release of this README.md file.

Known issues

There are no known issues in this plugin.