How to normalize RGB image?

When working with CNNs, in the image pre-processing part, we have to normalize the image for all the RGB channels that is specify three values for Mu and Sigma for each channel respectively. How do we know what these values are/ how to calculate these values beforehand on the training set as in the lectures, once the values that were chosen were [(0.5 0.5, 0.5),(0.5, 0.5, 0.5)] and for another example, there were different values across the channels.
PS: this question is regarding the proper use of transforms.Normalize

Hi @rdandriyal, the mean and std values used for normalization are findings from the ImageNet RGB images data.
Ideally, we should find mean and std for the images used in our data and use it in normalization, but most of the times it becomes an overhead, so we use mean and std for a different set of images i.e ImageNet in our case.

So, for most tasks I can use the same mean and std as used for imageNet?

Yes, for most tasks…