1
$\begingroup$

So, I'm using a pretrained PNASNet-5-Large model to do some image classification.

In the file, it says that the input range is in [0,1] (I'm assuming pixel values of input images). The images I have are already in this range. The channel means and standard deviation for RGB channels are stated as [0.5, 0.5, 0.5], [0.5, 0.5, 0.5] respectively. Now when I use the torchvision.transforms.Normalize to normalize the images using the stated means and standard deviations, the pixel values get to the range [-1,1].

The code I wrote for normalization:

transforms.Normalize([0.5, 0.5, 0.5],[0.5, 0.5, 0.5])

I believe I'm missing something fundamental. Should I normalize the images or should I not? Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$
  1. Standardization of the pixel values would bring it mean close to 0 and standard deviation as 1.
  2. Normalization will squeeze the values between 0 and 1. For RGB images, divide each channel i.e each pixel value by 255. For reference regarding Standardization see here and for normalization see here.
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .