diff --git a/test/test_transforms_video.py b/test/test_transforms_video.py index 193e71a3983..2bb72e9889f 100644 --- a/test/test_transforms_video.py +++ b/test/test_transforms_video.py @@ -1,6 +1,7 @@ from __future__ import division import torch -import torchvision.transforms as transforms +import torchvision.transforms._transforms_video as transforms +from torchvision.transforms import Compose import unittest import random import numpy as np @@ -20,7 +21,7 @@ def test_random_crop_video(self): oheight = random.randint(5, (height - 2) / 2) * 2 owidth = random.randint(5, (width - 2) / 2) * 2 clip = torch.randint(0, 256, (numFrames, height, width, 3), dtype=torch.uint8) - result = transforms.Compose([ + result = Compose([ transforms.ToTensorVideo(), transforms.RandomCropVideo((oheight, owidth)), ])(clip) @@ -36,7 +37,7 @@ def test_random_resized_crop_video(self): oheight = random.randint(5, (height - 2) / 2) * 2 owidth = random.randint(5, (width - 2) / 2) * 2 clip = torch.randint(0, 256, (numFrames, height, width, 3), dtype=torch.uint8) - result = transforms.Compose([ + result = Compose([ transforms.ToTensorVideo(), transforms.RandomResizedCropVideo((oheight, owidth)), ])(clip) @@ -57,7 +58,7 @@ def test_center_crop_video(self): ow1 = (width - owidth) // 2 clipNarrow = clip[:, oh1:oh1 + oheight, ow1:ow1 + owidth, :] clipNarrow.fill_(0) - result = transforms.Compose([ + result = Compose([ transforms.ToTensorVideo(), transforms.CenterCropVideo((oheight, owidth)), ])(clip) @@ -68,7 +69,7 @@ def test_center_crop_video(self): oheight += 1 owidth += 1 - result = transforms.Compose([ + result = Compose([ transforms.ToTensorVideo(), transforms.CenterCropVideo((oheight, owidth)), ])(clip) @@ -80,7 +81,7 @@ def test_center_crop_video(self): oheight += 1 owidth += 1 - result = transforms.Compose([ + result = Compose([ transforms.ToTensorVideo(), transforms.CenterCropVideo((oheight, owidth)), ])(clip) diff --git a/torchvision/transforms/__init__.py b/torchvision/transforms/__init__.py index 175a8a8dc1b..7986cdd6429 100644 --- a/torchvision/transforms/__init__.py +++ b/torchvision/transforms/__init__.py @@ -1,2 +1 @@ from .transforms import * -from .transforms_video import * diff --git a/torchvision/transforms/functional_video.py b/torchvision/transforms/_functional_video.py similarity index 100% rename from torchvision/transforms/functional_video.py rename to torchvision/transforms/_functional_video.py diff --git a/torchvision/transforms/transforms_video.py b/torchvision/transforms/_transforms_video.py similarity index 99% rename from torchvision/transforms/transforms_video.py rename to torchvision/transforms/_transforms_video.py index e11d8489eb8..aa1a4b05314 100644 --- a/torchvision/transforms/transforms_video.py +++ b/torchvision/transforms/_transforms_video.py @@ -8,7 +8,7 @@ RandomResizedCrop, ) -from . import functional_video as F +from . import _functional_video as F __all__ = [