Skip to content

Commit 5a35f3f

Browse files
Add convert tests for rotated boxes
Test Plan: Unit tests: ```bash pytest test/test_transforms_v2.py -vvv -k "TestConvertBoundingBoxFormat and test_kernel" pytest test/test_transforms_v2.py -vvv -k "TestConvertBoundingBoxFormat and test_kernel_noop" ```
1 parent 3966ff2 commit 5a35f3f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/test_transforms_v2.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,8 +3846,14 @@ def test_rand_augment_num_ops_error(self, num_ops):
38463846

38473847

38483848
class TestConvertBoundingBoxFormat:
3849-
old_new_formats = list(itertools.permutations(SUPPORTED_BOX_FORMATS, 2))
3850-
old_new_formats += list(itertools.permutations(NEW_BOX_FORMATS, 2))
3849+
old_new_formats = list(
3850+
itertools.permutations(
3851+
[f for f in tv_tensors.BoundingBoxFormat if not tv_tensors.is_rotated_bounding_format(f)], 2
3852+
)
3853+
)
3854+
old_new_formats += list(
3855+
itertools.permutations([f for f in tv_tensors.BoundingBoxFormat if tv_tensors.is_rotated_bounding_format(f)], 2)
3856+
)
38513857

38523858
@pytest.mark.parametrize(("old_format", "new_format"), old_new_formats)
38533859
def test_kernel(self, old_format, new_format):
@@ -3858,7 +3864,7 @@ def test_kernel(self, old_format, new_format):
38583864
old_format=old_format,
38593865
)
38603866

3861-
@pytest.mark.parametrize("format", SUPPORTED_BOX_FORMATS)
3867+
@pytest.mark.parametrize("format", list(tv_tensors.BoundingBoxFormat))
38623868
@pytest.mark.parametrize("inplace", [False, True])
38633869
def test_kernel_noop(self, format, inplace):
38643870
input = make_bounding_boxes(format=format).as_subclass(torch.Tensor)

0 commit comments

Comments
 (0)