chainer.functions.roi_pooling_2d

chainer.functions.roi_pooling_2d(x, rois, outh, outw, spatial_scale)[source]

Spatial Region of Interest (ROI) pooling function.

This function acts similarly to max_pooling_2d(), but it computes the maximum of input spatial patch for each channel with the region of interest.

Parameters
  • x (Variable) – Input variable. The shape is expected to be 4 dimensional: (n: batch, c: channel, h, height, w: width).

  • rois (Variable) – Input roi variable. The shape is expected to be (n: data size, 5), and each datum is set as below: (batch_index, x_min, y_min, x_max, y_max).

  • outh (int) – Height of output image after pooled.

  • outw (int) – Width of output image after pooled.

  • spatial_scale (float) – Scale of the roi is resized.

Returns

Output variable.

Return type

Variable

See the original paper proposing ROIPooling: Fast R-CNN.