Skip to content

Commit

Permalink
Updates to README, fix bug with loading previous output.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjc committed Mar 8, 2016
1 parent 429f613 commit 4c3a288
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Neural Doodle
=============

Do you want to borrow the skills of other artists to turn your two-bit doodles into fine artworks? Look no further! This project is an implementation of `Semantic Style Transfer <http://arxiv.org/abs/1603.01768>`_ (Champandard, 2016), based on the `Neural Patches <http://arxiv.org/abs/1601.04589>`_ algorithm (Li 2016).
Do you want to use a deep neural network to borrow the skills of other artists to turn your two-bit doodles into fine artworks? Look no further! This project is an implementation of `Semantic Style Transfer <http://arxiv.org/abs/1603.01768>`_ (Champandard, 2016), based on the `Neural Patches <http://arxiv.org/abs/1601.04589>`_ algorithm (Li 2016).

Once the project is setup, you can specify two or three images as inputs: the original style, its annotated-version, your own doodle, and optionally a target image. The algorithm will then extract annotated patches from the style image, and incrementally transfer them over to the target image based on how closery they match.

**NOTE**: This project is possible thanks to the `nucl.ai Conference <http://nucl.ai/>`_ on **July 18-20**. Join us in **Vienna**!

Expand Down Expand Up @@ -51,19 +53,19 @@ Frequest Questions
Q: How is semantic style transfer different to neural 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 some early impressions:
It's still very early too say definitively, both approaches were discovered independently by `@alexjc <https://twitter.com/alexjc>`_ and `@awentzonline <https://twitter.com/awentzonline>`_ (respectively). Here are some 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!
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 even more similar under the hood!

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.
2. Both use a `patch-based approach <http://arxiv.org/abs/1601.04589>`_ (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.
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.
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 priorwhich could improve the quality of the results in theory. In practice, it's hard to tell at this stage.
5. Semantic style transfer is **about 25% faster and uses less memory** too. For neural analogies, the extra computation is effectively the analogy priorwhich could improve the quality of the results in theory. In practice, it's hard to tell at this stage.

If you have any comparisons or insightns, be sure to let us know!
If you have any comparisons or insights, be sure to let us know!

----

Expand Down
3 changes: 3 additions & 0 deletions doodle.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ class NeuralGenerator(object):
def __init__(self):
self.model = Model()

if args.output is not None and os.path.isfile(args.output):
os.remove(args.output)

filename_image = args.content or args.output
filename_map = os.path.splitext(filename_image)[0]+args.semantic_ext

Expand Down

0 comments on commit 4c3a288

Please sign in to comment.