diffusion_policy
diffusion_policy copied to clipboard
Incorrect Image Normalization
Hi @cheng-chi, this work is incredible! I read the code carefully and I have a doubt about image normalization.
For example, in real_pusht_image_dataset.py, the following code normalizes the image to [-1, 1]
for key in self.rgb_keys:
normalizer[key] = get_image_range_normalizer()
return normalizer
In multi_image_obs_encoder.py, ImageNet statistics are also used in the code, but this requires the image to be between [0, 1]
if imagenet_norm:
this_normalizer = torchvision.transforms.Normalize(
mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
I don’t know what the impact of this bug is on the final performance, but it may be that there is something wrong with my understanding.
Agree. I think its a bug, and values should be [-1,1] only when: imagenet_norm=False