Unverified Commit 74d5e71d authored by Nicolas Hug's avatar Nicolas Hug Committed by GitHub
Browse files

Deprecate _transforms_video and _functional_video (#3441)



* deprecate _video modules

* flake8
Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent 2e8c124f
import torch import torch
import torchvision.transforms._transforms_video as transforms
from torchvision.transforms import Compose from torchvision.transforms import Compose
import unittest import unittest
import random import random
import numpy as np import numpy as np
import warnings
try: try:
from scipy import stats from scipy import stats
...@@ -11,6 +11,11 @@ except ImportError: ...@@ -11,6 +11,11 @@ except ImportError:
stats = None stats = None
with warnings.catch_warnings(record=True):
warnings.simplefilter("always")
import torchvision.transforms._transforms_video as transforms
class TestVideoTransforms(unittest.TestCase): class TestVideoTransforms(unittest.TestCase):
def test_random_crop_video(self): def test_random_crop_video(self):
......
import torch import torch
import warnings
warnings.warn(
"The _functional_video module is deprecated. Please use the functional module instead."
)
def _is_tensor_video_clip(clip): def _is_tensor_video_clip(clip):
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import numbers import numbers
import random import random
import warnings
from torchvision.transforms import ( from torchvision.transforms import (
RandomCrop, RandomCrop,
...@@ -21,6 +22,11 @@ __all__ = [ ...@@ -21,6 +22,11 @@ __all__ = [
] ]
warnings.warn(
"The _transforms_video module is deprecated. Please use the transforms module instead."
)
class RandomCropVideo(RandomCrop): class RandomCropVideo(RandomCrop):
def __init__(self, size): def __init__(self, size):
if isinstance(size, numbers.Number): if isinstance(size, numbers.Number):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment