|
| 1 | +## Adaptive Style Transfer in TensorFlow and TensorLayer |
| 2 | + |
| 3 | +### Usage |
| 4 | + |
| 5 | +1. TensorLayer implementation of the ICCV 2017 Paper [Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization](https://arxiv.org/abs/1703.06868) which supports any styles in one single model. |
| 6 | + |
| 7 | +2. You can use the <b>train.py</b> script to train your own model. To train the model, you need to download [MSCOCO dataset](http://cocodataset.org/#download) and [Wikiart dataset](https://www.kaggle.com/c/painter-by-numbers), and put the dataset images under the <b>'dataset/COCO\_train\_2014'</b> folder and <b>'dataset/wiki\_all\_images'</b> folder. |
| 8 | + |
| 9 | + |
| 10 | +3. Alternatively, you can use the <b>test.py</b> script to run my pretrained models. My pretrained models can be downloaded from [here](https://github.com/tensorlayer/pretrained-models/tree/master/models/style_transfer_pretrained_models), and should be put into the <b>'pretrained_models'</b> folder for testing. The example images for testing can be download from [here](https://github.com/tensorlayer/pretrained-models/tree/master/models/style_transfer_models_and_examples) |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +### Results |
| 15 | + |
| 16 | +Here are some result images (Left to Right: Content , Style , Result): |
| 17 | + |
| 18 | +<div align="center"> |
| 19 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/content/content_1.png" width=250 height=250> |
| 20 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/style/style_5.png" width=250 height=250> |
| 21 | + <img src="./images/output/style_5_content_1.jpg" width=250 height=250> |
| 22 | +</div> |
| 23 | + |
| 24 | + |
| 25 | +<div align="center"> |
| 26 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/content/content_2.png" width=250 height=250> |
| 27 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/style/style11.png" width=250 height=250> |
| 28 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/output/style_11_content2.png" width=250 height=250> |
| 29 | +</div> |
| 30 | + |
| 31 | +<div align="center"> |
| 32 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/content/chicago.jpg" width=250 height=250> |
| 33 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/style/cat.jpg" width=250 height=250> |
| 34 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/output/cat_chicago.jpg" width=250 height=250> |
| 35 | +</div> |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +<div align="center"> |
| 40 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/content/lance.jpg" width=250 height=250> |
| 41 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/style/lion.jpg" width=250 height=250> |
| 42 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/output/lion_lance.jpg" width=250 height=250> |
| 43 | +</div> |
| 44 | +<div align="center"> |
| 45 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/content/content_4.png" width=250 height=250> |
| 46 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/style/style_6.png" width=250 height=250> |
| 47 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/output/style_6_content_4.jpg" width=250 height=250> |
| 48 | +</div> |
| 49 | + |
| 50 | +<div align="center"> |
| 51 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/content/lance.jpg" width=250 height=250> |
| 52 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/style/udnie.jpg" width=250 height=250> |
| 53 | + <img src="https://github.com/tensorlayer/pretrained-models/blob/master/models/style_transfer_models_and_examples/images/output/udnie_lance.jpg" width=250 height=250> |
| 54 | +</div> |
| 55 | + |
| 56 | +Enjoy! |
| 57 | + |
| 58 | +### License |
| 59 | + |
| 60 | +- This project for academic use only. |
0 commit comments