How to Change Input Size from Pretrained Model?

Hello, maybe this my first question looks like dump :slight_smile: (i hope not haha)

Currently im working on some Computer vision problem.
then i want to use various model, like Resnet, EfficientNet, ViT, etc.

then come up some problem when input_size doesnt match up with weight transforms.
for example. in ViT Weights has 2 weight: IMAGENET1K_SWAG_E2E_V1 and IMAGENET1K_SWAG_LINEAR_V1.

these 2 works on 518 and 224 minimum image size.

so let say i want to use IMAGENET1K_SWAG_E2E_V1, how i can change input image from 518 to (like) 150x150?

thanks in advanced.
Any help would be appreciated.

I’m unsure if you want to resize the images to a self-defined size or if you want to use the transformation used during the pretraining of the model. In the latter case you can create the weights and use weights.transforms() as seen here.