Shortcuts

mmcv.ops.rel_roi_point_to_rel_img_point

mmcv.ops.rel_roi_point_to_rel_img_point(rois: Tensor, rel_roi_points: Tensor, img: tuple | Tensor, spatial_scale: float = 1.0) Tensor[source]

Convert roi based relative point coordinates to image based absolute point coordinates.

Parameters:
  • rois (torch.Tensor) – RoIs or BBoxes, shape (N, 4) or (N, 5)

  • rel_roi_points (torch.Tensor) – Point coordinates inside RoI, relative to RoI, location, range (0, 1), shape (N, P, 2)

  • img (tuple or torch.Tensor) – (height, width) of image or feature map.

  • spatial_scale (float, optional) – Scale points by this factor. Default: 1.

Returns:

Image based relative point coordinates for sampling, shape (N, P, 2).

Return type:

torch.Tensor