I am trying to print some images using the tensorboard. After reading this link I saw that input images are normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225] but once I try to denormalize them with the following
mean = (0.485, 0.456, 0.406)
std = (0.229, 0.224, 0.225)
mean = torch.Tensor(mean)[None, ..., None, None]
std = torch.Tensor(std)[None, ..., None, None]
return torch.clamp((img * std + mean)*255, 0, 255)
I receive a very strange set of image colors:
And after changing the channels I've got this (the number of rows doesn't matter, that was a change)
When I don't do any normalization, the images are like this
Has anyone had something like this before? I believe I did as I had to do with the normalization but maybe I'm wrong on it
I just realized that there was a transformation from Albumentation related to pixels augmentation. That's why it was not possible to do a simple normalization, since some other transformations related to colors were already applied.