/mobilenet-styletransfer

Implementation of A Neural Algorithm of Artistic Style(Gatys et. al.) but with MobileNetV2 backend instead of VGG.

Primary LanguagePythonMIT LicenseMIT

Neural Style Transfer with MobileNetV2

1. Usage

  • install requirements: pip install -r requirements.py
  • run style transfer: python nst.py
  • for more options: python nst.py --help

2. Losses

  • Content Loss: MSE Loss between feature maps at layer L of content image and output image.
  • Style Loss: MSE Loss between gram matrix of feature maps at different layers of style image and output image.

Loss Layers

Output feature maps of the following layers are used to compute the following losses:

  • Content Loss: InvertedResidualBlock #4.
  • Style Loss: InvertedResidualBlock #1, #2, #4, #7 and #14.

3. Outputs

All images are resized to (imsize, imsize) before processing. Here, imsize=256 and optimized for 50 Iterations.

Content Image Style Image Output Image(50 Itrs)