scratchai
scratchai copied to clipboard
Resize - Aspect Ratio
The resize implementation under get_trf uses val = (int(trf[2:]), int(trf[2:])) This does not keep the aspect ratio, which is a problem in rectangle size inputs. val = int(trf[2:]) will solve it, since torch resize already handles it. https://pytorch.org/vision/stable/transforms.html "If size is an int, smaller edge of the image will be matched to this number."