leongatys / PytorchNeuralStyleTransfer

Implementation of Neural Style Transfer in Pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imagenet normalization

Nick-Morgan opened this issue · comments

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?

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.