arbitrary_style_transfer
arbitrary_style_transfer copied to clipboard
Converting to BGR in style_transfer_net.py
Hey,
I was going through the code and I cant understand why you convert the inputs from RGB to BGR.
Would be grateful for any help,
Best
The original VGG19 was trained on images loaded as BGR from OpenCV and so expects that channel order. See https://github.com/jcjohnson/neural-style/issues/207
The second key preprocessing step of the VGG nets is subtracting the mean pixel across ImageNet for each color channel. In this codebase that's performed here https://github.com/elleryqueenhomels/arbitrary_style_transfer/blob/c5730fa38624cf6ff9738b26b4c7340e96acd809/encoder.py#L79