wiz-io/handwritten-digits
Viewer โข Updated โข 10k โข 37
Writes numbers in handwriting. Ask for "2026" and it draws each digit in a fresh handwriting style:
A conditional variational autoencoder (digit_writer.py, about 0.3M parameters) trained for 50 epochs on
wiz-io/handwritten-digits, a 10k-image subset of MNIST. Final training loss:
95.7 (reconstruction 74.6 + KL 21.1, per image).
Each row below is one digit, written ten times with different random styles:
import sys
from huggingface_hub import hf_hub_download
sys.path.insert(0, hf_hub_download("wiz-io/handwritten-digits-generator", "digit_writer.py").rsplit("/", 1)[0])
from digit_writer import DigitWriter
model = DigitWriter.from_pretrained("wiz-io/handwritten-digits-generator")
model.write_number("2026", temperature=0.8).save("number.png")
Lower temperature gives neater, more average digits; higher gives more varied, messier ones.
train.py runs as a Hugging Face Job on CPU. It keeps its working files (a snapshot of the MNIST source,
per-epoch checkpoints for resuming, metrics and sample grids) in the private bucket
wiz-io/handwritten-digits-training.