finds.dev

hardmaru/sketch-rnn

Multilayer LSTM and Mixture Density Network for modelling path-level SVG Vector Graphics data in TensorFlow

View on GitHub

★ 816Pythonupdated Oct 2018

// the take

The original research implementation behind hardmaru's sketch-rnn: an LSTM combined with a Mixture Density Network that learns to generate vector (SVG path) sketches, trained here on KanjiVG characters and TU Berlin sketches. It's for people curious about generative sequence models for drawing, not for anyone wanting a production sketch generator.

Historically significant - this is the code behind the well-known 'RNN dreams up fake Chinese characters' blog post that helped popularize MDN+RNN sketch generation, later rewritten and published properly in Magenta. Small and readable: model.py, train.py and sample.py are short enough to actually read end to end and understand the MDN/RNN mechanics. Ships a pretrained checkpoint and preprocessed KanjiVG data so sampling works out of the box with no setup. Includes its own minimal SVG path parser (svg/path) with actual unit tests, useful in isolation if you need a dependency-free bezier/line path parser.

The README itself says it's deprecated in favor of the Magenta version - the author is telling you not to build on this one. Targets TensorFlow 0.50, which predates the entire TF1/TF2 API; none of the training or sampling code runs against any TF you'd install today without a substantial rewrite. Python 2-era code (cPickle, old-style string formatting) needs porting before it even imports on Python 3. Only handles single-category training - the README warns that mixing shape categories (elephants, buildings, insects) just produces gibberish, which rules out training on any realistic multi-class dataset.

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
816
Forks
127
Language
Python
Last commit
25 Oct 2018

// nearby

If sketch-rnn isn't quite it.

All repos →