Transformer OCR by lasal.ai
Transformers · attention instead of columns

Reading by looking

loading…
Loading the model into your browser
Microsoft's TrOCR (61.6 million weights, 59 MB as int8). It runs entirely on your device.

The model loads first. Then type a line, write one, or pick a sample.

The line, and where the model looks for the selected word piece
What it wrote, one word piece at a time · click a piece
What the encoder sees
Squashed to 384 × 384 and cut into 24 × 24 = 576 patches of 16 × 16 pixels.
Its top guesses for this piece
Looking back at its own words (decoder self-attention, last layer)
Built by lasal.ai · TrOCR: M. Li et al., "TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models", AAAI 2023; Microsoft, MIT licence (github.com/microsoft/unilm) · onnxruntime-web (MIT) · A. Vaswani et al., "Attention Is All You Need", 2017 · CTC: A. Graves et al., 2006