VieSVTR v7 β€” Vietnamese + English text-line recognition

A small, fast single-pass CTC recogniser for one cropped text line (Vietnamese and English). 7.66 M parameters, input height 64 px, any width up to 1600 px. Built at the MLCV lab (UIT) to replace a VGG-Transformer VietOCR model in production.

Input one cropped text line, RGB, any size (resized to height 64, width rounded to a multiple of 4, 32–1600 px)
Output text + mean confidence (greedy CTC)
Parameters 7.66 M (β‰ˆ 31 MB fp32)
Charset 229 characters (Vietnamese letters with all diacritics, Latin, digits, punctuation, space)
Files weights/viesvtr_v7.onnx (ONNX, opset 17, dynamic width) Β· weights/viesvtr_v7.safetensors (PyTorch)

It does not find text on a page. Pair it with a text-line detector, then send each line crop.

Try it in your browser: ngocthua830/VieSVTR-demo β€” the ONNX model runs locally with ONNX Runtime Web, so your image is not uploaded. app.py is a Gradio version of the same demo for running on your own machine (pip install gradio onnxruntime pillow numpy && python3 app.py).

Quick start

pip install onnxruntime numpy pillow opencv-python-headless
python3 predict.py examples/vi_date.png
# examples/vi_date.png	Ngày 25 thÑng 10 năm 2026	0.993
from viesvtr.infer import OnnxRecognizer        # or TorchRecognizer("weights/viesvtr_v7.safetensors")
rec = OnnxRecognizer("weights/viesvtr_v7.onnx")
text, conf = rec("line.jpg")                      # path, PIL image or RGB numpy array

Architecture

3Γ—64Γ—W β†’ conv stem (stride 4) β†’ 3 residual conv stages (vertical stride only) β†’ 4Γ—W/4
       β†’ learned height collapse β†’ 3 self-attention blocks (local conv positional encoding) β†’ CTC head (230 classes)

Design choices: height 64 (a Vietnamese vowel can carry a modifier and a tone mark stacked above it; at 32 px those marks fall below one feature row, and many long lines have fewer CTC steps than characters), one forward pass (no autoregressive decoding, so latency does not grow with text length), and auxiliary base-letter / diacritic CTC heads during training only (dropped at inference).

Results on public test sets

Full test splits, ONNX Runtime on CPU, text NFC-normalised and whitespace-collapsed. CER = character error rate. eval/eval_lines.py reproduces every number in this table.

Test set Lines VieSVTR v7 CER ↓ VieSVTR exact ↑ VietOCR baseline CER ↓ VietOCR exact ↑
VinText (Vietnamese scene text) 8,421 6.13% 85.2% 15.16% 68.9%
CORD (receipts) 1,040 1.59% 87.6% 26.91% 49.4%
MC-OCR (Vietnamese receipts) 521 6.62% 66.4% 12.51% 42.6%
HierText (English) ⚠️ 37,883 6.89% 66.0% β€” β€”
TextOCR (English scene) ⚠️ 13,483 17.26% 65.1% β€” β€”

Baseline: the public VietOCR vgg_transformer checkpoint (37.6 M parameters, autoregressive), as deployed in our lab, scored with the same script on the same lines.

Contamination note. The training mix includes Union14M, which shares upstream images with HierText and TextOCR, so those two rows are optimistic and should not be read as clean English benchmarks. VinText, CORD and MC-OCR test splits were not used for training.

Speed (same GPU, Quadro RTX 8000, batch 1): about 12 ms per line vs about 98 ms for the VGG-Transformer baseline; about 264 MiB of GPU memory.

Training data

About 3.1 million text lines from 17 sources: public datasets (Union14M, HierText, TextOCR, VinText, CORD, MC-OCR and others), rendered synthetic Vietnamese text, and private in-house data (Vietnamese administrative documents, ID-card fields, receipts, handwriting). The private data is not released. No training image is distributed with this model; the images in examples/ are synthetic and were rendered for this card.

Limitations

  • One line at a time; rotated, curved or multi-line crops are out of scope.
  • Weaker on English receipts and on unusual scanned documents than on the domains above.
  • Greedy decoding, no language model; the confidence is a mean of per-step probabilities, not a calibrated probability.

License

CC BY-NC 4.0 (non-commercial). Some training datasets allow non-commercial research use only, so commercial use is not permitted. See LICENSE.

Citation

@misc{viesvtr2026,
  title  = {VieSVTR: a single-pass CTC text-line recogniser for Vietnamese and English},
  author = {MLCV Lab, University of Information Technology (VNU-HCM)},
  year   = {2026},
  note   = {Model release v7}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using ngocthua830/viesvtr 1