Skip to content

Commit 468f55b

Browse files
committed
lint
1 parent 15b0d78 commit 468f55b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

test/test_tv_tensors.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,5 +433,10 @@ def test_return_type_input():
433433

434434

435435
def test_box_clamping_mode_default():
436-
assert tv_tensors.BoundingBoxes([0., 0., 10., 10.], format="XYXY", canvas_size=(100, 100)).clamping_mode == "soft"
437-
assert tv_tensors.BoundingBoxes([0., 0., 10., 10., 0.], format="XYWHR", canvas_size=(100, 100)).clamping_mode == "soft"
436+
assert (
437+
tv_tensors.BoundingBoxes([0.0, 0.0, 10.0, 10.0], format="XYXY", canvas_size=(100, 100)).clamping_mode == "soft"
438+
)
439+
assert (
440+
tv_tensors.BoundingBoxes([0.0, 0.0, 10.0, 10.0, 0.0], format="XYWHR", canvas_size=(100, 100)).clamping_mode
441+
== "soft"
442+
)

torchvision/tv_tensors/_bounding_boxes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ class BoundingBoxFormat(Enum):
4242
# this can be put into BoundingBoxFormat as staticmethod
4343
def is_rotated_bounding_format(format: Union[BoundingBoxFormat, str]) -> bool:
4444
if isinstance(format, BoundingBoxFormat):
45-
return (format == BoundingBoxFormat.XYWHR or format == BoundingBoxFormat.CXCYWHR or format == BoundingBoxFormat.XYXYXYXY)
45+
return (
46+
format == BoundingBoxFormat.XYWHR
47+
or format == BoundingBoxFormat.CXCYWHR
48+
or format == BoundingBoxFormat.XYXYXYXY
49+
)
4650
elif isinstance(format, str):
4751
return format in ("XYWHR", "CXCYWHR", "XYXYXYXY")
4852
else:

0 commit comments

Comments
 (0)