Feat: Add roi_align_rotated - #36
Conversation
|
@DerrickUnleashed , |
Keep both roi_align_rotated (feature branch) and box_iou_rotated (main) across all generated export/build/registration files.
Yes I have completed resolving them |
The TORCH_LIBRARY_FRAGMENT schema registration was not being picked up
at runtime across shared libraries on macOS, causing
findSchemaOrThrow("torchvision::roi_align_rotated") to fail.
Bypass the PyTorch dispatcher by calling the CPU kernels and autograd
function directly instead of routing through findSchemaOrThrow.
cregouby
left a comment
There was a problem hiding this comment.
praise Nice addition, clear and straightforward, thanks
todo indexing and documentation
| #' Performs RoI align pooling for rotated proposals, as implemented by the MMCV | ||
| #' `roi_align_rotated` operator |
There was a problem hiding this comment.
todo Please mention in plain english Regions of interest in the sentence.
| #' | ||
| #' Performs RoI align pooling for rotated proposals, as implemented by the MMCV | ||
| #' `roi_align_rotated` operator | ||
| #' (see <https://mmcv.readthedocs.io/en/latest/deployment/mmcv_ops_definition.html#mmcvroialignrotated>). |
There was a problem hiding this comment.
todo this URL do not bring any additionnal information of what is present here. Please remove
| #' | ||
| #' @param input (`Tensor[N, C, H, W]`): input feature map. | ||
| #' @param rois (`Tensor[K, 6]`): rotated boxes with columns | ||
| #' `(batch_index, cx, cy, w, h, angle)`, where `batch_index` is a **0-based** |
There was a problem hiding this comment.
todo 0-indexing is considered as a bug in R. So end-user will never conform to that. Could we switch to 1-based index, Please ?
| #' Default: `FALSE` | ||
| #' | ||
| #' @returns | ||
| #' `Tensor[K, C, output_size[1], output_size[2]]`: the pooled features, where |
There was a problem hiding this comment.
todo clarification Can we use output width and output height here as we are in documentation, not in code.
| #' index into the first dimension of `input`, `(cx, cy)` is the box center, | ||
| #' `(w, h)` the box size and `angle` the rotation angle in radians | ||
| #' (counterclockwise unless `clockwise = TRUE`). | ||
| #' @param output_size (int or `Tuple[int, int]`): the output size `(height, width)` |
There was a problem hiding this comment.
todo Tuple is a unclear concept for the R users. Please use "(integer vector or interger)" like in https://github.com/mlverse/torchvision/blob/61e2c5008a81270146309d9a988edf88bde65575/R/transforms-generics.R#L66
Adds
ops_roi_align_rotated()/nn_roi_align_rotated(), a CPU RoI align pooling op for rotated boxes, ported from mmcv (Apache-2.0). Includes dispatcher + autograd kernels, R API + docs, and tests.Closes #32