Skip to content

Commit 79daca1

Browse files
authored
Make video transforms private (#1429)
1 parent e48b958 commit 79daca1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

test/test_transforms_video.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import division
22
import torch
3-
import torchvision.transforms as transforms
3+
import torchvision.transforms._transforms_video as transforms
4+
from torchvision.transforms import Compose
45
import unittest
56
import random
67
import numpy as np
@@ -20,7 +21,7 @@ def test_random_crop_video(self):
2021
oheight = random.randint(5, (height - 2) / 2) * 2
2122
owidth = random.randint(5, (width - 2) / 2) * 2
2223
clip = torch.randint(0, 256, (numFrames, height, width, 3), dtype=torch.uint8)
23-
result = transforms.Compose([
24+
result = Compose([
2425
transforms.ToTensorVideo(),
2526
transforms.RandomCropVideo((oheight, owidth)),
2627
])(clip)
@@ -36,7 +37,7 @@ def test_random_resized_crop_video(self):
3637
oheight = random.randint(5, (height - 2) / 2) * 2
3738
owidth = random.randint(5, (width - 2) / 2) * 2
3839
clip = torch.randint(0, 256, (numFrames, height, width, 3), dtype=torch.uint8)
39-
result = transforms.Compose([
40+
result = Compose([
4041
transforms.ToTensorVideo(),
4142
transforms.RandomResizedCropVideo((oheight, owidth)),
4243
])(clip)
@@ -57,7 +58,7 @@ def test_center_crop_video(self):
5758
ow1 = (width - owidth) // 2
5859
clipNarrow = clip[:, oh1:oh1 + oheight, ow1:ow1 + owidth, :]
5960
clipNarrow.fill_(0)
60-
result = transforms.Compose([
61+
result = Compose([
6162
transforms.ToTensorVideo(),
6263
transforms.CenterCropVideo((oheight, owidth)),
6364
])(clip)
@@ -68,7 +69,7 @@ def test_center_crop_video(self):
6869

6970
oheight += 1
7071
owidth += 1
71-
result = transforms.Compose([
72+
result = Compose([
7273
transforms.ToTensorVideo(),
7374
transforms.CenterCropVideo((oheight, owidth)),
7475
])(clip)
@@ -80,7 +81,7 @@ def test_center_crop_video(self):
8081

8182
oheight += 1
8283
owidth += 1
83-
result = transforms.Compose([
84+
result = Compose([
8485
transforms.ToTensorVideo(),
8586
transforms.CenterCropVideo((oheight, owidth)),
8687
])(clip)

torchvision/transforms/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
from .transforms import *
2-
from .transforms_video import *

torchvision/transforms/transforms_video.py renamed to torchvision/transforms/_transforms_video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
RandomResizedCrop,
99
)
1010

11-
from . import functional_video as F
11+
from . import _functional_video as F
1212

1313

1414
__all__ = [

0 commit comments

Comments
 (0)