vincentfung13/MINE

Why image normalization twice

Stephanie-ustc opened this issue · 2 comments

Hi,
Image normalization is realized by "img_transforms" when loading image in function of "nerf_dataset.py" . Why normalize the input image again in "ResnetEncoder forward step" ???

Hi,

Technically the input image is not normalized twice:

  • In nerf_dataset.py, the image is diveded by 255.0 by ToTensor().
  • In the ResNet encoder, we subtract the mean and divde by the variance.

The reason for this is we wanted to better utilize ImageNet pretrained weights by normalizing the inputs as is done in the pretraining, without having to "unormalize" the ground truth image to be within [0.0, 1.0] for further visualization and loss computation (for the small LLFF dataset we pre-processe the dataset in advance and keep the images in memory).

My apologies to the confusions. Hope this helps.

Zijian

Oh,you're right. I'm sorry I didn't see it clearly.Thank you for your reply.