I am trying to use a popular pre-trained VGG model for image classification in PyTorch but noticed that the image is resized to 256 and crop it to 224 for pre-processing images in most of the programs. I am curious why we do resize it to 256 first and crop it instead of resizing it to 224 directly.
transforms = transforms.Compose([transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize([0.485, 0.456, 0.406],
[0.229, 0.224, 0.225])])