overflocat / fast-neural-style-keras

A Keras Implementation of Fast-Neural-Style
MIT License
23 stars 7 forks source link
fast-neural-style keras style-transfer

This is a Keras implementation of Fast-Neural-Style (link)

Results



You could also use it to train a network combining two different styles. Here are some results:



These images are generated by combining two styles above.

How to use it

For training the network:

python main.py -c ./configs/[config_name] -m train

For predicting:

python main.py -c ./configs/[config_name] -m predict -i [image_read_path] -o [image_save_path]

For viewing the baseline: (link)

python main.py -c ./configs/[config_name] -m temp_view -i [image_read_path] -o [image_save_path] --iters [ITER]

The implementation of viewing base line is a little different from the original paper and shares the same loss net with training process, so you could use this temp_view function to adjust the hyperparameters.

For training the network, you should download COCO dataset first and unzip it to the train_image_path, which is specified in the config files.

Here is the explanation for parameters in config files:

Performance

It takes about 8 hours to train a network on a Nvidia K80 GPU. After training, predicting will be really fast and only use less than one second.