← all repositories
DmitryUlyanov/texture_nets

Neural style transfer that trades patience for training time

A 2016 Torch/Lua implementation that makes artistic style transfer instant—after you train a generator for hours.

1.2k stars Lua Image · Video · Audio
texture_nets
Velocity · 7d
+0.3
★ / day
Trend
steady
star history

What it does

Trains a feed-forward neural network to apply artistic styles to images in one shot, rather than optimizing each image separately like the original Gatys method. The repo includes training and testing scripts for stylization, plus (incomplete) texture generation. It runs on Torch7 with optional CUDA acceleration.

The interesting bit

The authors swapped batch normalization for instance normalization, which they credit with making the generator actually learn something useful. They also note the honest surprise that training on just 16 images didn’t overfit—a refreshing admission in a field that usually pretends more data is always the answer.

Key highlights

  • Feed-forward inference: ~0.25 seconds for 1024×768 once trained
  • Implements both the original Texture Networks paper and the improved instance-norm variant
  • Includes a pretrained model (with explicit caveat: “not the model from the paper”)
  • Based on Justin Johnson’s neural-style code, extended with generator-network training
  • Online demo hosted on RiseML for trying without installing Torch

Caveats

  • Texture generation section is marked “soon” with commented-out, half-finished instructions
  • Requires Torch7—a deep-learning framework now largely superseded by PyTorch
  • Authors openly admit they couldn’t match Gatys’s artistic quality due to “balance problems”
  • Hardware tested only on 12GB Titan X; memory constraints likely on modern cards with different architectures

Verdict

Worth studying if you’re tracing the evolution of fast style transfer or need to reproduce 2016-era results. Skip it if you want something that runs today without archaeology—Johnson’s original and subsequent PyTorch implementations have better ecosystem support.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.