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
538d87b1
Commit
538d87b1
authored
Sep 17, 2017
by
Sasank Chilamkurthy
Browse files
Fix a bug in randomsizedcrop
parent
f4ddc924
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 @
538d87b1
...
@@ -245,6 +245,7 @@ def scaled_crop(img, x, y, w, h, size, interpolation=Image.BILINEAR):
...
@@ -245,6 +245,7 @@ def scaled_crop(img, x, y, w, h, size, interpolation=Image.BILINEAR):
assert
_is_pil_image
(
img
),
'img should be PIL Image'
assert
_is_pil_image
(
img
),
'img should be PIL Image'
img
=
crop
(
img
,
x
,
y
,
w
,
h
)
img
=
crop
(
img
,
x
,
y
,
w
,
h
)
img
=
scale
(
img
,
size
,
interpolation
)
img
=
scale
(
img
,
size
,
interpolation
)
return
img
def
hflip
(
img
):
def
hflip
(
img
):
...
@@ -552,12 +553,12 @@ class RandomSizedCrop(object):
...
@@ -552,12 +553,12 @@ class RandomSizedCrop(object):
This is popularly used to train the Inception networks.
This is popularly used to train the Inception networks.
Args:
Args:
size:
size of the smaller
edge
size:
expected output size of each
edge
interpolation: Default: PIL.Image.BILINEAR
interpolation: Default: PIL.Image.BILINEAR
"""
"""
def
__init__
(
self
,
size
,
interpolation
=
Image
.
BILINEAR
):
def
__init__
(
self
,
size
,
interpolation
=
Image
.
BILINEAR
):
self
.
size
=
size
self
.
size
=
(
size
,
size
)
self
.
interpolation
=
interpolation
self
.
interpolation
=
interpolation
@
staticmethod
@
staticmethod
...
@@ -566,7 +567,6 @@ class RandomSizedCrop(object):
...
@@ -566,7 +567,6 @@ class RandomSizedCrop(object):
Args:
Args:
img (PIL.Image): Image to be cropped.
img (PIL.Image): Image to be cropped.
output_size (tuple): Expected output size of the crop.
Returns:
Returns:
tuple: params (x, y, w, h) to be passed to ``crop`` for a random
tuple: params (x, y, w, h) to be passed to ``crop`` for a random
...
...
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