Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jorgechato/cool-fst
Keras implementation for fast-style-transform CNN
https://github.com/jorgechato/cool-fst
keras python tensorflow
Last synced: 27 days ago
JSON representation
Keras implementation for fast-style-transform CNN
- Host: GitHub
- URL: https://github.com/jorgechato/cool-fst
- Owner: jorgechato
- Created: 2018-03-13T09:45:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T08:06:12.000Z (almost 7 years ago)
- Last Synced: 2024-11-07T10:46:06.022Z (3 months ago)
- Topics: keras, python, tensorflow
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# COOL-FST [TensorFlow](https://github.com/tensorflow/tensorflow)
Add styles from any pattern to any photo in a fraction of a second!
This project is inspired by the work of lengstrom in [fast-style-transfer](https://github.com/lengstrom/fast-style-transfer)
Our implementation is based off of a combination of Gatys' [A Neural Algorithm of Artistic Style](https://arxiv.org/abs/1508.06576), Johnson's [Perceptual Losses for Real-Time Style Transfer and Super-Resolution](http://cs.stanford.edu/people/jcjohns/eccv16/), and Ulyanov's [Instance Normalization](https://arxiv.org/abs/1607.08022).
## Implementation Details
Our implementation uses TF and Keras to train a fast style transfer network. We use roughly the same transformation network as described in Johnson, except that batch normalization is replaced with Ulyanov's instance normalization, and the scaling/offset of the output `tanh` layer is slightly different. We use a loss function close to the one described in Gatys, using VGG19 instead of VGG16 and typically using "shallower" layers than in Johnson's implementation (e.g. we use `relu1_1` rather than `relu1_2`). Empirically, this results in larger scale style features in transformations.## Documentation
### Training Style Transfer Networks
Use `style.py` to train a new style transfer network. Run `python style.py` to view all the possible parameters. Training takes 4-6 hours on a Maxwell Titan X. [More detailed documentation here](docs.md#stylepy). **Before you run this, you should run `setup.sh`**. Example usage:### Evaluating Style Transfer Networks
Use `evaluate.py` to evaluate a style transfer network. Run `python evaluate.py` to view all the possible parameters. Evaluation takes 100 ms per frame (when batch size is 1) on a Maxwell Titan X. [More detailed documentation here](docs.md#evaluatepy). Takes several seconds per frame on a CPU. **Models for evaluation are [located here](https://drive.google.com/drive/folders/0B9jhaT37ydSyRk9UX0wwX3BpMzQ?usp=sharing)**. Example usage:### Citation
```
@misc{engstrom2016faststyletransfer,
author = {Logan Engstrom},
title = {Fast Style Transfer},
year = {2016},
howpublished = {\url{https://github.com/lengstrom/fast-style-transfer/}},
note = {commit xxxxxxx}
}
```