Hello, I am trying to normalize my images which are of type uint16. But somehow the values are not in the range (0,1). The sample code has been attached. Any help is appreciated. Thanks
class CustomDataset(Dataset):
def init(self, image_paths, target_paths, train=True):   # initial logic happens like transform
    self.image_paths = image_paths
    self.target_paths = target_paths
   
    self.transforms  = transforms.Compose([
transforms.ToTensor(),transforms.Normalize((691.0994607113063, 891.5849978397365, 1019.7352398111965,3172.54439667618),(238.88659552814724,267.57694692565684,347.344288531034,689.5044531578629))])
    self.transforms2 =transforms.Compose([transforms.ToTensor()])



def __getitem__(self, index):


   
    img = np.moveaxis(img,0,-1)
    img = img.astype(np.float64)
 
    #img = Image.fromarray(img,'RGBA')
   # img.verify()
    mask = gdal.Open(self.target_paths[index],gdal.GA_ReadOnly)
    mask = mask.ReadAsArray()
    
    mask = to_categorical(mask, 14)
    
    mask =np.expand_dims(mask,axis=0)
    mask = np.moveaxis(mask,0,-1)

    mask = mask.astype(np.float64)
    mask1 = np.zeros((250,250,14),dtype=np.float64)
   
    for i in range(14):
        mask1[:,:,i]=(Image.fromarray(mask[:,:,i].reshape(250,250)))
    t_image = self.transforms(img)
    t_masks = self.transforms2(mask1)
    return t_image, t_masks

def __len__(self):  # return count of sample we have

    return len(self.image_paths)

train_dataset = CustomDataset(X_train, Y_train, train=True)
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=8, shuffle=True, num_workers=1)