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
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