RoiAlign

Description

Performs a pooling operation in each Region of Interest (ROI).

Input

  • x: 4D input tensor of type float16 or float. The data format is NCHW, and the shape is (N, C, H, W).
  • rois: ROIs. The data type can be float16 or float. The shape is (num_rois, 4).
  • batch_indices: index of the image corresponding to the batch. The data type is int64. The shape is (num_rois,).

Output

y: output tensor of the identical data type to input x, with a shape of (num_rois, C, output_height, output_width).

Attribute

  • mode: string. Defaults to avg.
  • output_height: int. Defaults to 1.
  • output_width: int. Defaults to 1.
  • sampling_ratio: int. Number of sampling points of the interpolation algorithm. Defaults to 0.
  • spatial_scale: float. Spatial sampling rate relative to the input image. Defaults to 1.0.
  • coordinate_transformation_mode: string: whether to offset the input value. The default value is half_pixel. This attribute is supported in Opset v16 and later versions.

Constraints

The input of float64 is not supported when the atc tool parameter --precision_mode=must_keep_origin_dtype is used.

ONNX Opset Support

Opset v10/v11/v12/v13/v14/v15/v16/v17/v18