paddle.fluid.layers.prroi_pool(input, rois, spatial_scale=1.0, pooled_height=1, pooled_width=1, name=None)[source]

The precise roi pooling implementation for paddle?

  • input (Variable) – The input of Deformable PSROIPooling.The shape of input tensor is [N,C,H,W]. Where N is batch size,C is number of input channels,H is height of the feature, and W is the width of the feature.

  • rois (Variable) – ROIs (Regions of Interest) to pool over.It should be a 2-D LoDTensor of shape (num_rois, 4), the lod level is 1. Given as [[x1, y1, x2, y2], …], (x1, y1) is the top left coordinates, and (x2, y2) is the bottom right coordinates.

  • spatial_scale (float) – Ratio of input feature map height (or width) to raw image height (or width). Equals the reciprocal of total stride in convolutional layers, Default: 1.0.

  • pooled_height (integer) – The pooled output height. Default: 1.

  • pooled_width (integer) – The pooled output width. Default: 1.

  • name (str, default None) – The name of this operation.


The shape of the returned Tensor is (num_rois, output_channels, pooled_h, pooled_w), with value type float32,float16..

Return type



import paddle.fluid as fluid
x ='x', shape=[490, 28, 28], dtype='float32')
rois ='rois', shape=[4], lod_level=1, dtype='float32')
pool_out = fluid.layers.prroi_pool(x, rois, 1.0, 7, 7)