HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jcjohnson
neural-style
Lua2015–2017
jcjohnson / neural-style

neural-style

Torch implementation of neural style algorithm

20Distinct people
21Mentions
0Explicit recommenders
18.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Torch implementation of neural style algorithm

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month21 dated mentions

Observed mentions: 2015-09-02 06:43:23 UTC to 2017-11-24 11:45:40 UTC.

012342015-09-01 00:00:00 UTC to 2015-10-01 00:00:00 UTC (exclusive): 3 mentions; 2 submissions, 1 commentsSep 20152015-10-01 00:00:00 UTC to 2015-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-11-01 00:00:00 UTC to 2015-12-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-12-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2016-02-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments2016-02-01 00:00:00 UTC to 2016-03-01 00:00:00 UTC (exclusive): 4 mentions; 0 submissions, 4 comments2016-03-01 00:00:00 UTC to 2016-04-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2016-04-01 00:00:00 UTC to 2016-05-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-05-01 00:00:00 UTC to 2016-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-06-01 00:00:00 UTC to 2016-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-07-01 00:00:00 UTC to 2016-08-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-08-01 00:00:00 UTC to 2016-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-09-01 00:00:00 UTC to 2016-10-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2016-10-01 00:00:00 UTC to 2016-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsOct 20162016-11-01 00:00:00 UTC to 2016-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-12-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-01-01 00:00:00 UTC to 2017-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-02-01 00:00:00 UTC to 2017-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-03-01 00:00:00 UTC to 2017-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-04-01 00:00:00 UTC to 2017-05-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-05-01 00:00:00 UTC to 2017-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-06-01 00:00:00 UTC to 2017-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-07-01 00:00:00 UTC to 2017-08-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments2017-08-01 00:00:00 UTC to 2017-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-09-01 00:00:00 UTC to 2017-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-10-01 00:00:00 UTC to 2017-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2017-11-01 00:00:00 UTC to 2017-12-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsNov 2017

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Sep 20152015-09-01 00:00:00 UTC2015-10-01 00:00:00 UTC321
Oct 20152015-10-01 00:00:00 UTC2015-11-01 00:00:00 UTC000
Nov 20152015-11-01 00:00:00 UTC2015-12-01 00:00:00 UTC101
Dec 20152015-12-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
Jan 20162016-01-01 00:00:00 UTC2016-02-01 00:00:00 UTC312
Feb 20162016-02-01 00:00:00 UTC2016-03-01 00:00:00 UTC404
Mar 20162016-03-01 00:00:00 UTC2016-04-01 00:00:00 UTC202
Apr 20162016-04-01 00:00:00 UTC2016-05-01 00:00:00 UTC101
May 20162016-05-01 00:00:00 UTC2016-06-01 00:00:00 UTC000
Jun 20162016-06-01 00:00:00 UTC2016-07-01 00:00:00 UTC000
Jul 20162016-07-01 00:00:00 UTC2016-08-01 00:00:00 UTC101
Aug 20162016-08-01 00:00:00 UTC2016-09-01 00:00:00 UTC000
Sep 20162016-09-01 00:00:00 UTC2016-10-01 00:00:00 UTC101
Oct 20162016-10-01 00:00:00 UTC2016-11-01 00:00:00 UTC101
Nov 20162016-11-01 00:00:00 UTC2016-12-01 00:00:00 UTC000
Dec 20162016-12-01 00:00:00 UTC2017-01-01 00:00:00 UTC000
Jan 20172017-01-01 00:00:00 UTC2017-02-01 00:00:00 UTC000
Feb 20172017-02-01 00:00:00 UTC2017-03-01 00:00:00 UTC000
Mar 20172017-03-01 00:00:00 UTC2017-04-01 00:00:00 UTC101
Apr 20172017-04-01 00:00:00 UTC2017-05-01 00:00:00 UTC101
May 20172017-05-01 00:00:00 UTC2017-06-01 00:00:00 UTC000
Jun 20172017-06-01 00:00:00 UTC2017-07-01 00:00:00 UTC000
Jul 20172017-07-01 00:00:00 UTC2017-08-01 00:00:00 UTC110
Aug 20172017-08-01 00:00:00 UTC2017-09-01 00:00:00 UTC000
Sep 20172017-09-01 00:00:00 UTC2017-10-01 00:00:00 UTC000
Oct 20172017-10-01 00:00:00 UTC2017-11-01 00:00:00 UTC000
Nov 20172017-11-01 00:00:00 UTC2017-12-01 00:00:00 UTC101

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
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 <image.jpg> -content_image <image.jpg> OpenCL usage with NIN Model (This requires you download the NIN Imagenet model files as described above): th neural_style.lua -style_image examples/inputs/picasso_selfport1907.jpg -content_image examples/inputs/brad_pitt.jpg -output_image profile.png -model_file models/nin_imagenet_conv.caffemodel -proto_file models/train_val.prototxt -gpu 0 -backend clnn -num_iterations 1000 -seed 123 -content_layers relu0,relu3,relu7,relu12 -style_layers relu0,relu3,relu7,relu12 -content_weight 10 -style_weight 1000 -image_size 512 -optimizer adam To use multiple style images, pass a comma-separated list like this: -style_image starry_night.jpg,the_scream.jpg. Note that paths to images should not contain the ~ character to represent your home directory; you should instead use a relative path or a full absolute path. Options: -image_size: Maximum side length (in pixels) of of the generated image. Default is 512. -style_blend_weights: The weight for blending the style of multiple style images, as a comma-separated list, such as -style_blend_weights 3,7. By default all style images are equally weighted. -gpu: Zero-indexed ID of the GPU to use; for CPU mode set -gpu to -1. Optimization options: -content_weight: How much to weight the content reconstruction term. Default is 5e0. -style_weight: How much to weight the style reconstruction term. Default is 1e2. -tv_weight: Weight of total-variation (TV) regularization; this helps to smooth the image. Default is 1e-3. Set to 0 to disable TV regularization. -num_iterations: Default is 1000. -init: Method for generating the generated image; one of random or image. Default is random which uses a noise initialization as in the paper; image initializes with the content image. -optimizer: The optimization algorithm to use; either lbfgs or adam; default is lbfgs. L-BFGS tends to give better results, but uses more memory. Switching to ADAM will reduce memory usage; when using ADAM you will probably need to play with other parameters to get good results, especially the style weight, content weight, and learning rate; you may also want to normalize gradients when using ADAM. -learning_rate: Learning rate to use with the ADAM optimizer. Default is 1e1. -normalize_gradients: If this flag is present, style and content gradients from each layer will be L1 normalized. Idea from andersbll/neural_artistic_style. Output options: -output_image: Name of the output image. Default is out.png. -print_iter: Print progress every print_iter iterations. Set to 0 to disable printing. -save_iter: Save the image every save_iter iterations. Set to 0 to disable saving intermediate results. Layer options: -content_layers: Comma-separated list of layer names to use for content reconstruction. Default is relu4_2. -style_layers: Comma-separated list of layer names to use for style reconstruction. Default is relu1_1,relu2_1,relu3_1,relu4_1,relu5_1. Other options: -style_scale: Scale at which to extract features from the style image. Default is 1.0. -original_colors: If you set this to 1, then the output image
Read the full README on GitHub

What Hacker News says

21 sources
Real-time neural style transfer is not new; in the past year there have been several academic papers [1-4] on this topic and several open-source code releases: https://github.com/jcjohnson/fast-neural-style https://github.com/DmitryUlyanov/texture_nets https://github.com/chuanli11/MGANs Neural style blending is also not new; I did it more than a year ago using optimization-based method: https://github.com/jcjohnson/neural-style#multiple-style-ima... The novelty of this work is a clever way for training a single network that can apply many different styles; existing methods for real-time style transfer train separate networks per style. Their method also allows for real-time style blending, which is very cool and to my knowledge has not been done before. (Disclaimer: I'm the author of [2]) [1] Ulyanov et al, "Texture Networks: Feed-forward
Read the rest
Synthesis of Textures and Stylized Images", ICML 2016 [2] Johnson et al, "Perceptual Losses for Real-Time Style Transfer and Super-Resolution", ECCV 2016 [3] Li and Wand, "Precomputed Real-Time Texture Synthesis with Markovian Generative Adversarial Networks", ECCV 2016 [4] Ulyanov et al, "Instance Normalization: The Missing Ingredient for Fast Stylization", arXiv 2016
In Supercharging Style Transfer
I played with something similar for a while, https://github.com/jcjohnson/neural-style What I've found so far is that it takes a while to get good results like something that looks like its own creation instead of an overlap of pictures. There's no exact way to do this. If you modify existing artwork it works well enough since the source is already somewhat divorced from reality but photos are difficult. When it works it's amazing though.
In Turning two-bit doodles into fine artworks with deep neural networks

Showing the 15 most recent of 21 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.