3

Can anyone tell me in which situations the above functions are used and how they affect the image size? I want to resize the Cat V Dogs images and i am a bit confuse about how to use them.

jastor_007
  • 371
  • 4
  • 14

1 Answers1

5

There are lots of details in TorchVision documentation actually.

The typical use case is for object detection or image segmentation tasks, but other uses could exist.

Here is a non-exhaustive list of uses:

  • Resize is used in Convolutional Neural Networks to adapt the input image to the network input shape, in this case this is not data-augmentation but just pre-processing. It can also be used in Fully Convolutional Networks to emulate different scales for an input image, this is data-augmentation.
  • CenterCrop RandomCrop and RandomResizedCrop are used in segmentation tasks to train a network on fine details without impeding too much burden during training. For with a database of 2048x2048 images you can train on 512x512 sub-images and then at test time infer on full resolution images. It is also used in object detection networks as data-augmentation. The resized variant lets you combine the previous resize operation.

All of them potentially change the image resolution.

jss367
  • 4,759
  • 14
  • 54
  • 76
Louis Lac
  • 5,298
  • 1
  • 21
  • 36