Skip to content

Commit 269805e

Browse files
Document batch-less mode support in box_convert (#9324)
Co-authored-by: Nicolas Hug <[email protected]>
1 parent 3e61e22 commit 269805e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/ops/boxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def box_convert(boxes: Tensor, in_fmt: str, out_fmt: str) -> Tensor:
213213
x3, y3 bottom right, and x4, y4 bottom left.
214214
215215
Args:
216-
boxes (Tensor[N, K]): boxes which will be converted. K is the number of coordinates (4 for unrotated bounding boxes, 5 or 8 for rotated bounding boxes)
216+
boxes (Tensor[..., K]): boxes which will be converted. K is the number of coordinates (4 for unrotated bounding boxes, 5 or 8 for rotated bounding boxes). Supports any number of leading batch dimensions.
217217
in_fmt (str): Input format of given boxes. Supported formats are ['xyxy', 'xywh', 'cxcywh', 'xywhr', 'cxcywhr', 'xyxyxyxy'].
218218
out_fmt (str): Output format of given boxes. Supported formats are ['xyxy', 'xywh', 'cxcywh', 'xywhr', 'cxcywhr', 'xyxyxyxy']
219219
220220
Returns:
221-
Tensor[N, K]: Boxes into converted format.
221+
Tensor[..., K]: Boxes into converted format.
222222
"""
223223
if not torch.jit.is_scripting() and not torch.jit.is_tracing():
224224
_log_api_usage_once(box_convert)

0 commit comments

Comments
 (0)