diff --git a/README.rst b/README.rst index 147505b..b4b8def 100644 --- a/README.rst +++ b/README.rst @@ -1,13 +1,13 @@ Neural Doodle ============= -A minimalistic implementation of Semantic Style Transfer. +A minimalistic implementation of Semantic Style Transfer (Champandard, 2016), based on the Neural Patches algorithm (Li 2016). |Python Version| |License Type| |Project Stars| ---- -.. image:: docs/Landscape.png +.. image:: docs/Landscape_example.png Image Analogy ------------- @@ -40,7 +40,25 @@ installed system-wide. Afterwards, you can run the following commands from your # Setup the required dependencies simply using the PIP module. python3 -m pip install -r https://raw.githubusercontent.com/alexjc/neural-doodle/master/requirements.txt -.. image:: docs/Coastline.png +.. image:: docs/Coastline_example.png + +Frequest Questions +------------------ + +Q: How is semantic style transfer different than neural image analogies? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It's still very early too say definitively, both approaches were discovered independently at the same time by @alexjc and @awentzonline (respectively). Here are our early impressions: + +1. One algorithm is style transfer that happens to do analogies, and the other is analogies that happens to do style transfer now. Adam extended his implementation to use a content loss after the semantic style transfer paper was published, so now they're very similar! + +2. Both use a patch-based approach (Li, 2016) but semantic style transfer imposes a "prior" on the patch-selection process and neural analogies has an additional prior on the convolution activations. The outputs for both algorithms are a little different, it's not yet clear where each one is best. + +3. Semantic style transfer is simpler, it has fewer loss components. This means somewhat less code to write and there are fewer parameters involved (not necessarily positive or negative). Neural analogies is a little more complex, with as many parameters as the combination of two algorithms. + +4. Neural analogies is designed to work with images, and can only support the RGB format for its masks. Semantic style transfer was designed to integrate with other neural networks (for pixel labeling and semantic segmentation), and can use any format for its maps, including RGBA or many channels per label masks. + +5. Semantic style transfer is about 25% faster and uses less memory too. For neural analogies, the extra computation is effectively the analogy prior—which could improve the quality of the results in theory. In practice, it's hard to tell—let us know what you find! ---- diff --git a/docs/Landscape_example.png b/docs/Landscape_example.png new file mode 100644 index 0000000..afb3183 Binary files /dev/null and b/docs/Landscape_example.png differ diff --git a/doodle.py b/doodle.py index 7aa5a69..8ade691 100644 --- a/doodle.py +++ b/doodle.py @@ -28,7 +28,7 @@ parser.add_argument('--resolutions', default=3, type=int, help='Number of image scales to process.') parser.add_argument('--smoothness', default=1E+0, type=float, help='Weight of image smoothing scheme.') parser.add_argument('--seed', default='noise', type=str, help='Seed image path, "noise" or "content".') -parser.add_argument('--iterations', default=50, type=int, help='Number of iterations to run each resolution.') +parser.add_argument('--iterations', default=100, type=int, help='Number of iterations to run each resolution.') parser.add_argument('--device', default='cpu', type=str, help='Index of the GPU number to use, for theano.') parser.add_argument('--print-every', default=10, type=int, help='How often to log statistics to stdout.') parser.add_argument('--save-every', default=0, type=int, help='How frequently to save PNG into `frames`.')