chainer.functions.roi_max_align_2d¶
-
chainer.functions.
roi_max_align_2d
(x, rois, roi_indices, outsize, spatial_scale, sampling_ratio=None)[source]¶ Spatial Region of Interest (ROI) max align function.
This function acts similarly to
roi_max_pooling_2d()
, but it computes maximum of input spatial patch with bilinear interpolation for each channel with the region of interest.- Parameters
x (Variable) – Input variable. The shape is expected to be 4 dimentional:
(n: batch, c: channel, h, height, w: width)
.rois (Variable) – Input roi variable. The shape is expected to be
(n: data size, 4)
, and each datum is set as below:(y_min, x_min, y_max, x_max)
.roi_indices (Variable) – Input roi variable. The shape is expected to be
(n: data size, )
.outsize ((int, int) or int) – Expected output size after pooled (height, width).
outsize=o
andoutsize=(o, o)
are equivalent.spatial_scale (float) – Scale of the roi is resized.
sampling_ratio ((int, int) or int) – Sampling step for the alignment. It must be an integer over \(1\) or
None
, and the value is automatically decided whenNone
is passed. Use of different ratio in height and width axis is also supported by passing tuple of int as(sampling_ratio_h, sampling_ratio_w)
.sampling_ratio=s
andsampling_ratio=(s, s)
are equivalent.
- Returns
Output variable.
- Return type
See the original paper proposing ROIAlign: Mask R-CNN.