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
4d7f70b5
Commit
4d7f70b5
authored
Sep 19, 2017
by
Sasank Chilamkurthy
Browse files
scale change to (h, w) ordering. (based on #256)
parent
538d87b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchvision/transforms.py
torchvision/transforms.py
+3
-3
No files found.
torchvision/transforms.py
View file @
4d7f70b5
...
...
@@ -144,7 +144,7 @@ def scale(img, size, interpolation=Image.BILINEAR):
Args:
img (PIL.Image): Image to be scaled.
size (sequence or int): Desired output size. If size is a sequence like
(
w
,
h
), output size will be matched to this. If size is an int,
(
h
,
w
), output size will be matched to this. If size is an int,
smaller edge of the image will be matched to this number.
i.e, if height > width, then image will be rescaled to
(size * height / width, size)
...
...
@@ -172,7 +172,7 @@ def scale(img, size, interpolation=Image.BILINEAR):
ow
=
int
(
size
*
w
/
h
)
return
img
.
resize
((
ow
,
oh
),
interpolation
)
else
:
return
img
.
resize
(
size
,
interpolation
)
return
img
.
resize
(
size
[::
-
1
]
,
interpolation
)
def
pad
(
img
,
padding
,
fill
=
0
):
...
...
@@ -355,7 +355,7 @@ class Scale(object):
Args:
size (sequence or int): Desired output size. If size is a sequence like
(
w
,
h
), output size will be matched to this. If size is an int,
(
h
,
w
), output size will be matched to this. If size is an int,
smaller edge of the image will be matched to this number.
i.e, if height > width, then image will be rescaled to
(size * height / width, size)
...
...
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