Skip to content

Make the resize anchor edge variable if size is scalar #2868

Closed
@pmeier

Description

@pmeier

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

(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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions