Skip to content

Commit 87e821f

Browse files
Delete is_rotated_bounding_box_format function
1 parent 428a54c commit 87e821f

File tree

1 file changed

+1
-9
lines changed
  • torchvision/transforms/v2/functional

1 file changed

+1
-9
lines changed

torchvision/transforms/v2/functional/_meta.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,22 +263,14 @@ def _xyxyxyxy_to_xywhr(xyxyxyxy: torch.Tensor, inplace: bool) -> torch.Tensor:
263263
return xyxyxyxy[..., :5].to(dtype)
264264

265265

266-
def is_rotated_bounding_box_format(format: BoundingBoxFormat) -> bool:
267-
return format.value in [
268-
BoundingBoxFormat.XYWHR.value,
269-
BoundingBoxFormat.CXCYWHR.value,
270-
BoundingBoxFormat.XYXYXYXY.value,
271-
]
272-
273-
274266
def _convert_bounding_box_format(
275267
bounding_boxes: torch.Tensor, old_format: BoundingBoxFormat, new_format: BoundingBoxFormat, inplace: bool = False
276268
) -> torch.Tensor:
277269

278270
if new_format == old_format:
279271
return bounding_boxes
280272

281-
if is_rotated_bounding_box_format(old_format) ^ is_rotated_bounding_box_format(new_format):
273+
if tv_tensors.is_rotated_bounding_format(old_format) ^ tv_tensors.is_rotated_bounding_format(new_format):
282274
raise ValueError("Cannot convert between rotated and unrotated bounding boxes.")
283275

284276
# TODO: Add _xywh_to_cxcywh and _cxcywh_to_xywh to improve performance

0 commit comments

Comments
 (0)