+0
Daily
18,264
stars
2,628
forks
622
watchers
51
prs
439
issues
0
releases
README
neural-style This is a torch implementation of the paper A Neural Algorithm of Artistic Style by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge. The paper presents an algorithm for combining the content of one image with the style of another image using convolutional neural networks. Here's an example that maps the artistic style of The Starry Night onto a night-time photograph of the Stanford campus: Applying the style of different images to the same content image gives interesting results. Here we reproduce Figure 2 from the paper, which renders a photograph of the Tubingen in Germany in a variety of styles: Here are the results of applying the style of various pieces of artwork to this photograph of the golden gate bridge: Content / Style Tradeoff The algorithm allows the user to trade-off the relative weight of the style and content reconstruction terms, as shown in this example where we port the style of Picasso's 1907 self-portrait onto Brad Pitt: Style Scale By resizing the style image before extracting style features, we can control the types of artistic features that are transfered from the style image; you can control this behavior with the -style_scale flag. Below we see three examples of rendering the Golden Gate Bridge in the style of The Starry Night. From left to right, -style_scale is 2.0, 1.0, and 0.5. Multiple Style Images You can use more than one style image to blend multiple artistic styles. Clockwise from upper left: "The Starry Night" + "The Scream", "The Scream" + "Composition VII", "Seated Nude" + "Composition VII", and "Seated Nude" + "The Starry Night" Style Interpolation When using multiple style images, you can control the degree to which they are blended: Transfer style but not color If you add the flag -original_colors 1 then the output image will retain the colors of the original image; this is similar to the recent blog post by deepart.io. Setup: Dependencies: torch7 loadcaffe Optional dependencies: For CUDA backend: CUDA 6.5+ cunn For cuDNN backend: cudnn.torch For OpenCL backend: cltorch clnn After installing dependencies, you'll need to run the following script to download the VGG model: sh models/download_models.sh This will download the original VGG-19 model. Leon Gatys has graciously provided the modified version of the VGG-19 model that was used in their paper; this will also be downloaded. By default the original VGG-19 model is used. If you have a smaller memory GPU then using NIN Imagenet model will be better and gives slightly worse yet comparable results. You can get the details on the model from BVLC Caffe ModelZoo and can download the files from NIN-Imagenet Download Link You can find detailed installation instructions for Ubuntu in the installation guide. Usage Basic usage: th neural_style.lua -style_image -content_image OpenCL usage with NIN Model (This
Top issues
#376Implementing features from the "Controlling Perceptual Factors in Neural Style Transfer" research paper228 comments · 2017-02-10#292Where should I start if I want to train a model for usage with Neural-Style?131 comments · 2016-07-24#450Any ports to Python?98 comments · 2018-02-20#237Non-issue: relative style layers weights65 comments · 2016-05-31#428Loss values stay the same for every iteration, with extremely large image sizes52 comments · 2017-10-20#351What possibilities do I get with titan pascal sli42 comments · 2016-12-07#217Non-issue: added wiki pages for most common issues41 comments · 2016-05-01#334"th" command is not working in PHP over browser31 comments · 2016-10-06