BLIP icon indicating copy to clipboard operation
BLIP copied to clipboard

Why the resize does not preserve the original aspect ratio

Open yurymalkov opened this issue 2 years ago • 2 comments

Hi, thank you for the work!

I've played with the code and noticed that examples do not preserve the original aspect ration during the resize. E.g. https://github.com/salesforce/BLIP/blob/d10be550b2974e17ea72e74edc7948c9e5eab884/predict.py#L93 or the colab example.

I wonder if it is done on purpose?

yurymalkov avatar Dec 13 '22 17:12 yurymalkov

I came to ask the same question, is there no need to do letterboxing?

saffie91 avatar Dec 15 '22 15:12 saffie91

Thanks for your question. It is not necessary to preserve the original aspect ratio because the model was trained on augmented image crops with various ratios. We find this transform to perform slightly better than CenterCrop during inference.

LiJunnan1992 avatar Dec 21 '22 06:12 LiJunnan1992