Rescaling vs Target Size

First of all why do we need them, we can deal with normal size also…is it that reducing it the time as lesser pixel values to deal with?

But target size may change it to some different size ,it may reduce time but how dividing the values by 255 helps , i mean its within (0,1) but why is it useful?

hey @nikhil_sarda ,

  1. Sometimes it happens that you dataset is very large , even not able to fit in memory at once
    In this case we use data generators to generate batches of data ,which can easily be fitted into our model and hence doesn’t require much memory consumption for preparing data to be trained on.

  2. sometimes it so small that we need to generate more images from it using augmentation techniques
    In this case , we generate images using various augmentations , like horizontal or vertical flip etc…
    Rescaling is also a kind of augmentation technique ,which converts the value of each pixel to a specified range as specified by the user. Mostly it is between (0,1].
    How does this helps ? Large values of pixels require more computation and also takes time for model to converge. Rescaling these values down ,improves the speed of model and also the model is able to converge faster and more better. , leading to more information gain from those images

  3. sometimes images has variable shape ,means some images are very large in shape and some very small,etc.
    In this case we need to convert all images to a single shape , as deep learning models with variables inputs is not possible. So we use target size parameter to reshape our images to a particular size which we need to provide to our model.

I hope this would have helped you.
Thank You. :slightly_smiling_face: