Caligraf.ia
Personal project · 2026
Typed Portuguese in, handwritten pen strokes out. Trained from scratch, because the weights everyone uses are research-only and cannot ship.
- 0.42 → 0.70
- legibility, four rounds
- 21.6k
- synthetic stroke pairs
- ~9s
- generation, CPU
Why Portuguese
Handwriting models are trained and demoed on English. Portuguese carries accents (á, ã, ç, ê) that are one or two pixels wide, which is exactly what a naive skeletoniser throws away when it reduces a glyph to a stroke. Getting them to survive the data pipeline was most of the work.
Pipeline
Open-licence cursive fonts are thinned to a one-pixel skeleton and walked to recover a pen trajectory. Small components are preserved deliberately, so the accents make it into the training data instead of being erased by the thinning step.
The gate
Training loss kept falling while the output stayed unreadable. So the ruler is external and frozen: an OCR model reads back what the checkpoint wrote, and the similarity is the score. CI for a generative model.
Runtime
Who built it
The source is closed, it is a running product with transactions in it. If you want to confirm who is behind it, the privacy policy on caligrafia.app carries my name and the registered company.
PyTorch · Python · Flask · NumPy · TrOCR · scikit-image