Skip to content

Make video transforms private #1429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions test/test_transforms_video.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion torchvision/transforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .transforms import *
from .transforms_video import *
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
RandomResizedCrop,
)

from . import functional_video as F
from . import _functional_video as F


__all__ = [
Expand Down