finds.dev

jcjohnson/neural-style

Torch implementation of neural style algorithm

View on GitHub

★ 18,274LuaMITupdated Feb 2018

// the take

The reference Torch implementation of Gatys, Ecker and Bethge's 2015 neural style paper. It optimizes a noise image against VGG-19 features until it matches the content of one photo and the style of another, then writes a PNG. It suits people who want to run the paper's method on their own GPU, or who want readable code to check a reimplementation against.

- The style and content losses map directly onto the paper's equations, so the code works as a readable reference for the method.

- The option set covers the knobs that matter in practice: per-layer selection, style and content weights, style_scale, multiple style images with blend weights, and original_colors for keeping the photo's palette.

- Resource trade-offs are documented with real numbers: about 3.5GB of GPU memory by default, about 1GB with cuDNN and ADAM, and timings across three backends and two optimizers on two generations of Titan X.

- The backend and optimizer are swappable, and the README's own benchmarks show cudnn_autotune and ADAM each giving a measurable speedup.

- The stack is Torch7 and loadcaffe, both long unmaintained. Getting it running today means pinning old Lua rocks, which is why the FAQ is mostly version-fix entries.

- Every run is a fresh optimization of a single image. The README's own numbers put 500 iterations at 512px at about a minute on a 2015-era Titan X, which rules out anything interactive or batched. It has no feed-forward model, which is the approach later real-time style transfer work took.

- Quality depends on hand-tuned weights and layer lists. The README admits the NIN model and ADAM both need parameter tuning, and the author never got average pooling to work well. The last push was February 2018, and nothing here handles video or frame-to-frame consistency.

We read the README, the directory tree and a key source file in October 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
18,274
Forks
2,635
Language
Lua
License
MIT
Last commit
23 Feb 2018

// nearby

If neural-style isn't quite it.

All repos →