Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
79daca10
Unverified
Commit
79daca10
authored
Oct 08, 2019
by
Francisco Massa
Committed by
GitHub
Oct 08, 2019
Browse files
Make video transforms private (#1429)
parent
e48b9584
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
test/test_transforms_video.py
test/test_transforms_video.py
+7
-6
torchvision/transforms/__init__.py
torchvision/transforms/__init__.py
+0
-1
torchvision/transforms/_functional_video.py
torchvision/transforms/_functional_video.py
+0
-0
torchvision/transforms/_transforms_video.py
torchvision/transforms/_transforms_video.py
+1
-1
No files found.
test/test_transforms_video.py
View file @
79daca10
from
__future__
import
division
from
__future__
import
division
import
torch
import
torch
import
torchvision.transforms
as
transforms
import
torchvision.transforms._transforms_video
as
transforms
from
torchvision.transforms
import
Compose
import
unittest
import
unittest
import
random
import
random
import
numpy
as
np
import
numpy
as
np
...
@@ -20,7 +21,7 @@ class TestVideoTransforms(unittest.TestCase):
...
@@ -20,7 +21,7 @@ class TestVideoTransforms(unittest.TestCase):
oheight
=
random
.
randint
(
5
,
(
height
-
2
)
/
2
)
*
2
oheight
=
random
.
randint
(
5
,
(
height
-
2
)
/
2
)
*
2
owidth
=
random
.
randint
(
5
,
(
width
-
2
)
/
2
)
*
2
owidth
=
random
.
randint
(
5
,
(
width
-
2
)
/
2
)
*
2
clip
=
torch
.
randint
(
0
,
256
,
(
numFrames
,
height
,
width
,
3
),
dtype
=
torch
.
uint8
)
clip
=
torch
.
randint
(
0
,
256
,
(
numFrames
,
height
,
width
,
3
),
dtype
=
torch
.
uint8
)
result
=
transforms
.
Compose
([
result
=
Compose
([
transforms
.
ToTensorVideo
(),
transforms
.
ToTensorVideo
(),
transforms
.
RandomCropVideo
((
oheight
,
owidth
)),
transforms
.
RandomCropVideo
((
oheight
,
owidth
)),
])(
clip
)
])(
clip
)
...
@@ -36,7 +37,7 @@ class TestVideoTransforms(unittest.TestCase):
...
@@ -36,7 +37,7 @@ class TestVideoTransforms(unittest.TestCase):
oheight
=
random
.
randint
(
5
,
(
height
-
2
)
/
2
)
*
2
oheight
=
random
.
randint
(
5
,
(
height
-
2
)
/
2
)
*
2
owidth
=
random
.
randint
(
5
,
(
width
-
2
)
/
2
)
*
2
owidth
=
random
.
randint
(
5
,
(
width
-
2
)
/
2
)
*
2
clip
=
torch
.
randint
(
0
,
256
,
(
numFrames
,
height
,
width
,
3
),
dtype
=
torch
.
uint8
)
clip
=
torch
.
randint
(
0
,
256
,
(
numFrames
,
height
,
width
,
3
),
dtype
=
torch
.
uint8
)
result
=
transforms
.
Compose
([
result
=
Compose
([
transforms
.
ToTensorVideo
(),
transforms
.
ToTensorVideo
(),
transforms
.
RandomResizedCropVideo
((
oheight
,
owidth
)),
transforms
.
RandomResizedCropVideo
((
oheight
,
owidth
)),
])(
clip
)
])(
clip
)
...
@@ -57,7 +58,7 @@ class TestVideoTransforms(unittest.TestCase):
...
@@ -57,7 +58,7 @@ class TestVideoTransforms(unittest.TestCase):
ow1
=
(
width
-
owidth
)
//
2
ow1
=
(
width
-
owidth
)
//
2
clipNarrow
=
clip
[:,
oh1
:
oh1
+
oheight
,
ow1
:
ow1
+
owidth
,
:]
clipNarrow
=
clip
[:,
oh1
:
oh1
+
oheight
,
ow1
:
ow1
+
owidth
,
:]
clipNarrow
.
fill_
(
0
)
clipNarrow
.
fill_
(
0
)
result
=
transforms
.
Compose
([
result
=
Compose
([
transforms
.
ToTensorVideo
(),
transforms
.
ToTensorVideo
(),
transforms
.
CenterCropVideo
((
oheight
,
owidth
)),
transforms
.
CenterCropVideo
((
oheight
,
owidth
)),
])(
clip
)
])(
clip
)
...
@@ -68,7 +69,7 @@ class TestVideoTransforms(unittest.TestCase):
...
@@ -68,7 +69,7 @@ class TestVideoTransforms(unittest.TestCase):
oheight
+=
1
oheight
+=
1
owidth
+=
1
owidth
+=
1
result
=
transforms
.
Compose
([
result
=
Compose
([
transforms
.
ToTensorVideo
(),
transforms
.
ToTensorVideo
(),
transforms
.
CenterCropVideo
((
oheight
,
owidth
)),
transforms
.
CenterCropVideo
((
oheight
,
owidth
)),
])(
clip
)
])(
clip
)
...
@@ -80,7 +81,7 @@ class TestVideoTransforms(unittest.TestCase):
...
@@ -80,7 +81,7 @@ class TestVideoTransforms(unittest.TestCase):
oheight
+=
1
oheight
+=
1
owidth
+=
1
owidth
+=
1
result
=
transforms
.
Compose
([
result
=
Compose
([
transforms
.
ToTensorVideo
(),
transforms
.
ToTensorVideo
(),
transforms
.
CenterCropVideo
((
oheight
,
owidth
)),
transforms
.
CenterCropVideo
((
oheight
,
owidth
)),
])(
clip
)
])(
clip
)
...
...
torchvision/transforms/__init__.py
View file @
79daca10
from
.transforms
import
*
from
.transforms
import
*
from
.transforms_video
import
*
torchvision/transforms/functional_video.py
→
torchvision/transforms/
_
functional_video.py
View file @
79daca10
File moved
torchvision/transforms/transforms_video.py
→
torchvision/transforms/
_
transforms_video.py
View file @
79daca10
...
@@ -8,7 +8,7 @@ from torchvision.transforms import (
...
@@ -8,7 +8,7 @@ from torchvision.transforms import (
RandomResizedCrop
,
RandomResizedCrop
,
)
)
from
.
import
functional_video
as
F
from
.
import
_
functional_video
as
F
__all__
=
[
__all__
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment