Views
No views yet
| Feature | Description |
|---|---|
| Language | Ukrainian (handwritten + printed) |
| Architecture | HTR-ConvText (ResNet-18 + MobileViT), CTC decoding |
| Input | 64×3072 px, grayscale line images |
| Training | 1.7M samples, SAM, EMA, scan simulation |
| Formats | PyTorch, ONNX, Hugging Face AutoModel |
1from transformers import AutoModel, AutoProcessor
2
3processor = AutoProcessor.from_pretrained("Valerii02/ukr-htr-convtext", trust_remote_code=True)
4model = AutoModel.from_pretrained("Valerii02/ukr-htr-convtext", trust_remote_code=True)1inputs = processor(images="sample.png", return_tensors="pt")
2logits = model(**inputs).logits
3text = processor.batch_decode(logits)[0]
4print(text)💡 Try it now: Open the Gradio demo — no code required!
AutoModel + AutoProcessor).| Source | Samples |
|---|---|
| ukrainian-handwriting-synth | Synthetic handwritten lines |
| Ukrainian Handwritten Text | ~37k segmented lines |
| Total | 1,696,499 (Train 90% / Val 5% / Test 5%) |
| Example | Image | GT | Prediction | CER | WER |
|---|---|---|---|---|---|
| 1 | ![]() | Департаменту патрульної поліції | Департаменту нагрульної поліції | 0.065 | 0.33 |
| 2 | ![]() | за порушення правил дорожнього руху | за порушення правил дорожнього Дуку | 0.057 | 0.20 |
| File | Purpose |
|---|---|
prepare_hf_artifacts.py | Convert .pth checkpoint → HF artifacts |
export_onnx.py | Export to ONNX |
validate_parity.py | OpenCV vs PIL, PyTorch vs ONNX parity checks |
predict.py | Single-image CLI inference |
1python prepare_hf_artifacts.py \
2 --checkpoint-path /path/to/best_CER.pth \
3 --alphabet-path /path/to/alphabet.json \
4 --output-dir ./releasepython export_onnx.py --hf-model-dir ./release --output-dir ./onnx| Split | CER | WER | Notes |
|---|---|---|---|
| real-world (124) | 0.176 | 0.440 | Scanned docs, handwritten + printed |
format_string_for_wer normalization.ukr-htr-convtext) was compared against several vision–language and HTR baselines.| Model | Samples | CER (%) | WER (%) |
|---|---|---|---|
| mamay | 124 | 40.15 | 75.28 |
| finetuned-cyrillic-trocr | 124 | 46.45 | 78.96 |
| cyrillic-trocr | 124 | 51.92 | 97.93 |
| gpt-4o-mini | 124 | 56.19 | 88.75 |
| hunyuan | 124 | 124.80 | 180.78 |
| ukr-htr-convtext (Ours) | 124 | 17.63 | 44.04 |
ukr-htr-convtext model more than halves the character error rate relative to the next best system (mamay) and strongly outperforms generic and domain-adapted VLM/HTR baselines.NOTICE and CITATION.cff for details.
Upstream (HTR-ConvText):1@misc{truc2025htrconvtext,
2 title={HTR-ConvText: Leveraging Convolution and Textual Information for Handwritten Text Recognition},
3 author={Pham Thach Thanh Truc and Dang Hoai Nam and Huynh Tong Dang Khoa and Vo Nguyen Le Duy},
4 year={2025},
5 eprint={2512.05021},
6 archivePrefix={arXiv},
7 primaryClass={cs.CV},
8 url={https://arxiv.org/abs/2512.05021},
9}CITATION.cff for full attribution.LICENSE.