Nikronic / CoarseNet

Modified version of U-net based on "Convolutional Networks for Biomedical Image Segmentation (Ronneberger et al., 2015)" paper.
https://arxiv.org/abs/1505.04597
MIT License
25 stars 2 forks source link

Normalization is required #6

Closed Nikronic closed 5 years ago

Nikronic commented 5 years ago

Using normalization in custom transforms required as below:


normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])
Nikronic commented 5 years ago

I am still not sure what values should be used. In the pytorch community, it has been mentioned that using

normalize = transforms.Normalize(mean=[0.5, 0.5, 0.5],
                                 std=[0.5, 0.5, 0.5])

converts [0,1] images into [-1,1] and this is our goal too.

By the way, we used VGG as part of the loss function, and it seems, it uses different normalization numbers.

Nikronic commented 5 years ago

All pytorch vision models use following normalization: https://github.com/pytorch/examples/blob/master/imagenet/main.py#L197-L198 Which is obtained from here: https://discuss.pytorch.org/t/how-to-preprocess-input-for-pre-trained-networks/683/2?u=nikronic