Oulu-IMEDS / solt

Streaming over lightweight data transformations
https://oulu-imeds.github.io/solt/
MIT License
263 stars 19 forks source link

Make resize() with int input keep ratio aspect #75

Closed hoanghng closed 2 years ago

hoanghng commented 4 years ago

The transformation resize will distort ratio aspect if the input image is not square and resize_to is int. https://github.com/MIPT-Oulu/solt/blob/50b064b398306ff0b21f8c39968e9201b697ddc1/solt/transforms/_transforms.py#L637-L638

I'd request to avoid that from happening. The feature is available in Resize of TorchVision (https://pytorch.org/docs/stable/torchvision/transforms.html#torchvision.transforms.Resize).