How sjvasquez/handwriting-synthesis works
This is a research implementation of Graves-style handwriting synthesis. The main user flow supplies text plus optional style exemplars and bias to Hand.write, which samples stroke sequences with the pretrained recurrent model and writes SVG. A separate data-preparation and training path supports retraining. The graph preserves the documented style/priming and bias capabilities; edges are limited to README statements and visible source-index references, so unsampled internals are not inferred.
Main entry points: demo.py Hand API · rnn.py Recurrent model · prepare_data.py Corpus preparation · tf_base_model.py Training runtime
Components 17
Generation interface
- Hand API
demo.py - Demo lyrics
lyrics.py - Style exemplars
styles - Stroke sampler
rnn.py - SVG output
demo.py
Data and rendering
- Corpus preparation
prepare_data.py - Raw handwriting data
data/raw - Prepared arrays
data - Stroke drawing utilities
drawing.py - Batch data frame
data_frame.py
Synthesis model
- Recurrent model
rnn.py - Attention LSTM cell
rnn_cell.py - Sequence operations
rnn_ops.py - Tensor utilities
tf_utils.py
Training runtime
- Training runtime
tf_base_model.py - Pretrained checkpoint
checkpoints
Other components
- Text user
Connections 16
- Text user → Hand API: provides text
readme.md - Hand API → Stroke sampler: requests samples
demo.py - Hand API → SVG output: writes SVG
readme.md - Hand API → Style exemplars: loads exemplars
demo.py - Hand API → Stroke drawing utilities: uses drawing
demo.py - Hand API → Demo lyrics: uses demo text
demo.py - Corpus preparation → Raw handwriting data: reads corpus
prepare_data.py - Corpus preparation → Stroke drawing utilities: encodes strokes
prepare_data.py - Corpus preparation → Prepared arrays: saves arrays
prepare_data.py - Stroke sampler → Recurrent model: runs model
demo.py - Recurrent model → Batch data frame: uses batches
rnn.py - Recurrent model → Attention LSTM cell: uses cell
rnn.py - Recurrent model → Sequence operations: uses sequence ops
rnn.py - Recurrent model → Tensor utilities: uses tensor ops
rnn.py - Recurrent model → Training runtime: inherits trainer
rnn.py - Training runtime → Pretrained checkpoint: restores model