Table Of Contents
The ROIAlign plugin implements the Region of Interest (RoI) align operation described in the Mask R-CNN paper, in compliance with the ONNX specification for the same (insofar as TRT limitations allow).
This plugin has the plugin creator class ROIAlignPluginCreator and the plugin class ROIAlign which extends IPluginV2DynamicExt.
The RoiAlign plugin consumes the following inputs:
Xwith shape (batch_size,C,height,width): An input tensor.roiswith shape (num_rois,4): Regions of interest (ROIs).batch_indiceswith shape (num_rois,): The set of indices inXto apply pooling. i.e. The ROI defined byrois[i], should be used to poolX[batch_indices[i]].
The RoiAlign plugin produces the following output:
Ywith shape (num_rois,C,output_height,output_width):Y[i]is the output produced when pooling is applied over the ROI defined byrois[i]onX[batch_indices[i]].
The ROIAlign plugin has the following parameters:
| Type | Parameter | Description |
|---|---|---|
int |
coordinate_transformation_mode |
Whether or not the input coordinates should be shifted by 0.5 pixels. Allowed values are 0 and 1. Default is 1 and indicates a shift. |
int |
mode |
The pooling method. Average pooling (indicated by 1) and max pooling (indicated by 0) are supported. Allowed values are 0 and 1. Default is 1. |
int |
output_height |
Height of the pooled output (Y). Allowed values are positive integers. Default is 1. |
int |
output_width |
Width of the pooled output (Y). Allowed values are positive integers. Default is 1. |
int |
sampling_ratio |
Number of sampling points in the interpolation grid used to compute the output value of each pooled output bin. If positive, then exactly sampling_ratio x sampling_ratio grid points are used. If zero, then an adaptive number of grid points are used (computed as ceil(roi_width / output_width), and likewise for height). Allowed values are non-negative integers. Default is 0. |
float |
spatial_scale |
Multiplicative factor used to translate the ROI coordinates from their input spatial scale to the scale used when pooling. Allowed values are positive. Default is 1.0. |
The following resources provide a deeper understanding of the ROIAlign plugin:
For terms and conditions for use, reproduction, and distribution, see the TensorRT Software License Agreement documentation.
June 2022: This is the first release of this README.md file.
There are no known issues in this plugin.