SANET
This is unofficial PyTorch implementation of "Arbitrary Style Transfer with Style-Attentional Networks".
Official paper: https://arxiv.org/abs/1812.02342v5
To run, download the weights and place them in the folder with Eval.py. Links to weights on Yandex.Disk:
-
decoder: https://yadi.sk/d/xsZ7j6FhK1dmfQ
-
transformer: https://yadi.sk/d/GhQe3g_iRzLKMQ
-
vgg_normalised: https://yadi.sk/d/7IrysY8q8dtneQ
Or, you can download the latest release. It contains all weights, codes and examples.
How to evaluate
To test the code, make changes to the following lines in the file Eval.py. here you need to specify the path to the image style and content. After that, save the changes to the file and run it.
parser.add_argument('--content', type=str, default = 'input/chicago.jpg',
help='File path to the content image')
parser.add_argument('--style', type=str, default = 'style/style11.jpg',
help='File path to the style image, or multiple style \
images separated by commas if you want to do style \
interpolation or spatial control')
How to train
You can train your own SANet using Train.ipynb
Examples
Original:
Stylized under 1.jpg:
Stylized under Composition-VII.jpg:
Stylized under Starry.jpg:
Stylized under candy.jpg:
Stylized under la_muse.jpg:
Stylized under rain_princess.jpg:
Stylized under seated_nude.jpg:
Stylized under style11.jpg:
Stylized under udnie.jpg:
Stylized under wave.jpg:
Stylized under wreck.jpg:
Original:
Stylized under 1.jpg:
Stylized under Composition-VII.jpg:
Stylized under Starry.jpg:
Stylized under candy.jpg:
Stylized under la_muse.jpg:
Stylized under rain_princess.jpg:
Stylized under seated_nude.jpg:
Stylized under style11.jpg:
Stylized under udnie.jpg:
Stylized under wave.jpg:
Stylized under wreck.jpg: