-
Implementation of A Neural Algorithm of Artistic Style but with MobileNetV2 or GhostNetV2_160.in1k instead of VGG.
-
Based on Neural Transfer Using PyTorch.
-
Apply whiten-color-transform(WCT) algorithm to further improve performance;
-
Apply channel-pruning algorithm to speed up training process without losing too much performance.
- install requirements:
pip install -r requirements.py
- run style transfer:
python nst.py
- for more options:
python nst.py --help
- 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.
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.
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) |
---|---|---|