jonzhaocn / cnnmrf-pytorch

41 stars 8 forks source link

question about denorm #5

Closed lujingqiao closed 3 years ago

lujingqiao commented 3 years ago

this is good job, help me a a lot! but still some question, wish to get you help.

first, i know mean and std of imagenet is (0.485, 0.456, 0.406), (0.229, 0.224, 0.225)), but i cannot understand why mean and std of denorm is (-2.12, -2.04, -1.80), (4.37, 4.46, 4.44), can you detail explain? thank you!

transform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize(mean=(0.485, 0.456, 0.406), std=(0.229, 0.224, 0.225))])
denorm_transform = transforms.Normalize(mean=(-2.12, -2.04, -1.80), std=(4.37, 4.46, 4.44))
jonzhaocn commented 3 years ago

Using an example to illustrate the red channel's denorm_transform, you can use the same solution for other channels. And the number is rounded to two decimals.

lujingqiao commented 3 years ago

clarity! thx again!