|
3 | 3 |
|
4 | 4 | import torch |
5 | 5 |
|
6 | | -import torchvision.transforms.v2.utils |
| 6 | +import torchvision.transforms.v2._utils |
7 | 7 | from common_utils import DEFAULT_SIZE, make_bounding_boxes, make_detection_mask, make_image |
8 | 8 |
|
9 | 9 | from torchvision import datapoints |
| 10 | +from torchvision.transforms.v2._utils import has_all, has_any |
10 | 11 | from torchvision.transforms.v2.functional import to_pil_image |
11 | | -from torchvision.transforms.v2.utils import has_all, has_any |
12 | 12 |
|
13 | 13 |
|
14 | 14 | IMAGE = make_image(DEFAULT_SIZE, color_space="RGB") |
|
37 | 37 | ((IMAGE, BOUNDING_BOX, MASK), (lambda obj: isinstance(obj, datapoints.Image),), True), |
38 | 38 | ((IMAGE, BOUNDING_BOX, MASK), (lambda _: False,), False), |
39 | 39 | ((IMAGE, BOUNDING_BOX, MASK), (lambda _: True,), True), |
40 | | - ((IMAGE,), (datapoints.Image, PIL.Image.Image, torchvision.transforms.v2.utils.is_pure_tensor), True), |
| 40 | + ((IMAGE,), (datapoints.Image, PIL.Image.Image, torchvision.transforms.v2._utils.is_pure_tensor), True), |
41 | 41 | ( |
42 | 42 | (torch.Tensor(IMAGE),), |
43 | | - (datapoints.Image, PIL.Image.Image, torchvision.transforms.v2.utils.is_pure_tensor), |
| 43 | + (datapoints.Image, PIL.Image.Image, torchvision.transforms.v2._utils.is_pure_tensor), |
44 | 44 | True, |
45 | 45 | ), |
46 | 46 | ( |
47 | 47 | (to_pil_image(IMAGE),), |
48 | | - (datapoints.Image, PIL.Image.Image, torchvision.transforms.v2.utils.is_pure_tensor), |
| 48 | + (datapoints.Image, PIL.Image.Image, torchvision.transforms.v2._utils.is_pure_tensor), |
49 | 49 | True, |
50 | 50 | ), |
51 | 51 | ], |
|
0 commit comments