Skip to content

Commit 249f547

Browse files
fmassaymao1993
andauthored
Allow passing list to the input argument 'scale' of RandomResizedCrop (#1997) (#2008)
Summary: Currently the scale argument can only be of type tuple or integer, this diff allows feeding the input argument `scale` with a list. Pull Request resolved: #1997 Test Plan: Without this diff, launching the following classy vision task causes error: https://our.intern.facebook.com/intern/fblearner/details/175876950/ With this diff, everything works fine: https://our.intern.facebook.com/intern/fblearner/details/175913768/ Reviewed By: resonatevision Differential Revision: D20544904 Pulled By: ymao1993 fbshipit-source-id: a95a2e9ceadec77fffe234756fb3b38b1b9c9cb1 Co-authored-by: Yu Mao <[email protected]>
1 parent d8ee268 commit 249f547

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/transforms/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ class RandomResizedCrop(object):
623623
"""
624624

625625
def __init__(self, size, scale=(0.08, 1.0), ratio=(3. / 4., 4. / 3.), interpolation=Image.BILINEAR):
626-
if isinstance(size, tuple):
626+
if isinstance(size, (tuple, list)):
627627
self.size = size
628628
else:
629629
self.size = (size, size)

0 commit comments

Comments
 (0)