Rotate a boxes by 90 degrees in the plane specified by `axes`. See box_ops.rot90_boxes for additional details Args: k: number of times to rotate by 90 degrees. spatial_axes: 2 int numbers, defines the plane to rotate with 2 spatial axes. Default: (0, 1), thi
| 544 | |
| 545 | |
| 546 | class RotateBox90(Rotate90): |
| 547 | """ |
| 548 | Rotate a boxes by 90 degrees in the plane specified by `axes`. |
| 549 | See box_ops.rot90_boxes for additional details |
| 550 | |
| 551 | Args: |
| 552 | k: number of times to rotate by 90 degrees. |
| 553 | spatial_axes: 2 int numbers, defines the plane to rotate with 2 spatial axes. |
| 554 | Default: (0, 1), this is the first two axis in spatial dimensions. |
| 555 | If axis is negative it counts from the last to the first axis. |
| 556 | """ |
| 557 | |
| 558 | backend = [TransformBackends.TORCH, TransformBackends.NUMPY] |
| 559 | |
| 560 | def __call__(self, boxes: NdarrayTensor, spatial_size: Sequence[int] | int) -> NdarrayTensor: # type: ignore[override] |
| 561 | """ |
| 562 | Args: |
| 563 | img: channel first array, must have shape: (num_channels, H[, W, ..., ]), |
| 564 | """ |
| 565 | return rot90_boxes(boxes, spatial_size, self.k, self.spatial_axes) |