Closed jppgks closed 6 years ago
The VGG network expects images to be preprocessed by subtracting the mean pixel values for the B, G, and R channels.
@anishathalye Thanks for your quick response.
I understand that the network is trained on images where the mean pixel has been subtracted. I just don't see what is stored in data['normalization']
. Are the mean pixel values stored there?
I think the man image is stored there, and the mean pixel can be calculated from that. Alternatively, we could have just hard-coded the mean pixel value.
I see. How would you hard-code the mean pixel value? I mean, how would you compute it?
mean_pixel = [103.939, 116.779, 123.68]
https://gist.github.com/baraldilorenzo/07d7802847aaad0a35d3#gistcomment-1616734
Ah, amazing 😊 I was seeing these constant values for the mean pixel, but I just didn't see where they were coming from. Thanks for freeing me from my confusion!
I'm trying to understand these two lines. https://github.com/anishathalye/neural-style/blob/b7461815c8fee73199709273c76daf69982db3ec/vgg.py#L26-L27
It seems like a mean value is being loaded from the data. Could you elaborate on what exactly is stored at
data['normalization']
? I'm trying to figure out what exactly it is the mean of.