leongatys / PytorchNeuralStyleTransfer

Implementation of Neural Style Transfer in Pytorch
MIT License
421 stars 103 forks source link

Imagenet normalization #11

Closed Nick-Morgan closed 4 years ago

Nick-Morgan commented 4 years ago

The pytorch docs (link) say to normalize images via

normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])

However, the notebook in this repo normalizes via

 transforms.Normalize(mean=[0.40760392, 0.45795686, 0.48501961],
                                                std=[1,1,1]

I am trying to re-create the results from the original paper, so I am just curious about this. Is this method of normalization specific to this task, did the imagenet normalizations for pytorch change over time, or is there some other reason I may be missing?

leongatys commented 4 years ago

The original VGG network (same as AlexNet etc.) did not rescale the input images. This was only done for the pytorch re-implementation. We used the original VGG network.