roi_align

dragon.vision.roi_align(
  inputs,
  pooled_h,
  pooled_w,
  spatial_scale=1.0,
  sampling_ratio=2,
  **kwargs
)[source]

Apply the average roi align. [He et.al, 2017].

The rois should be packed with a shape like \((N, 5)\), where \(N\) is the number of RoIs.

Each RoI is a 5d sequence containing (batch_index, x1, y1, x2, y2).

Parameters:
  • inputs (Sequence[dragon.Tensor]) – The tensor feature and rois.
  • pooled_h (int, required) – The output height.
  • pooled_w (int, required) – The output width.
  • spatial_scale (float, optional, default=1.) – The input scale to the size of rois.
  • sampling_ratio (int, optional, default=2) – The number of sampling grids for rois.
Returns:

dragon.Tensor – The output tensor.