-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
🚀 Feature
Make the resize anchor edge variable if size is scalar.
Motivation
Right now torchvision.transforms.Resize()
assumes that the smaller edge of the image should be resized to size if its an int
.
vision/torchvision/transforms/transforms.py
Lines 239 to 240 in d1e134c
(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. |
That can be cumbersome if the user wants for example an image that is not larger than x or wants a specific edge to be this size.
Pitch
I propose we add a edge
keyword argument which can be one of "short"
(default), "long"
, "vert"
, and "horz"
. Based on this we calculate the size.
cc @vfdev-5