Skip to content

Commit

Permalink
Deprecate _transforms_video and _functional_video (#3441)
Browse files Browse the repository at this point in the history
* deprecate _video modules

* flake8

Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
  • Loading branch information
NicolasHug and datumbox authored Feb 26, 2021
1 parent 2e8c124 commit 74d5e71
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/test_transforms_video.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import torch
import torchvision.transforms._transforms_video as transforms
from torchvision.transforms import Compose
import unittest
import random
import numpy as np
import warnings

try:
from scipy import stats
except ImportError:
stats = None


with warnings.catch_warnings(record=True):
warnings.simplefilter("always")
import torchvision.transforms._transforms_video as transforms


class TestVideoTransforms(unittest.TestCase):

def test_random_crop_video(self):
Expand Down
6 changes: 6 additions & 0 deletions torchvision/transforms/_functional_video.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import torch
import warnings


warnings.warn(
"The _functional_video module is deprecated. Please use the functional module instead."
)


def _is_tensor_video_clip(clip):
Expand Down
6 changes: 6 additions & 0 deletions torchvision/transforms/_transforms_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numbers
import random
import warnings

from torchvision.transforms import (
RandomCrop,
Expand All @@ -21,6 +22,11 @@
]


warnings.warn(
"The _transforms_video module is deprecated. Please use the transforms module instead."
)


class RandomCropVideo(RandomCrop):
def __init__(self, size):
if isinstance(size, numbers.Number):
Expand Down

0 comments on commit 74d5e71

Please sign in to comment.