How to normalize custom image dataset

Hi, can anybody tell me how to normalize the image and make the pixel values between (0,1)?
currently the pixel values of my normalized image data are all between (-1,1).

If your input tensor, which is normalized from [-1,1] is x, you should just have to do y = 0.5 + 0.5*x to get a new tensor y, which has the range [0,1].

You could also checkout out PyTorch’s torchvision.transforms.Normalize.