roi_align

dragon.vm.torchvision.ops.roi_align(
  input,
  boxes,
  output_size,
  spatial_scale=1.0,
  sampling_ratio=- 1,
  aligned=False
)[source]

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

The boxes should be packed with a shape like (N,5)(N, 5), where NN is the number of boxes.

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

Parameters:
  • input (dragon.vm.torch.Tensor) The input tensor.
  • boxes (dragon.vm.torch.Tensor) The box coordinates.
  • output_size (Sequence[int]) The output height and width.
  • spatial_scale (float, optional, default=1.0) The input scale to the size of boxes.
  • sampling_ratio (int, optional, default=-1) The number of sampling grids for boxes.
  • aligned (bool, optional, default=False) Whether to shift the input coordinates by -0.5.
Returns:

dragon.vm.torch.Tensor The output tensor.