Handwritten line recognizer for Persian / Arabic / English text plus math symbols, fine-tuned on the saeidseyfi/khattat dataset (line crops, input 32x256, max 88 label chars).
Model Card
By Saeid Seyfi, published under cc-by-4.0, revision 0d85d2bb1c7b.
Handwritten line recognizer for Persian / Arabic / English text plus math symbols, fine-tuned on the saeidseyfi/khattat dataset (line crops, input 32x256, max 88 label chars). CPU (2-core) budget fine-tune; decoder+head trained, STR backbone frozen The training pipeline is time-budgeted and fully resumable — continuing on a GPU with the same script converges substantially further. - best.pt -- model checkpoint (state dict + vocab) - vocab.txt -- 176-char vocabulary (fa / ar / en / digits / math) - demokhattatparseq.mp4 -- demo: test lines, ground truth vs prediction - evalreport.json, log.txt, worstsamples.json -- metrics
Read Saeid Seyfi's full model card
khattat PARSeq recognizer
Handwritten line recognizer for Persian / Arabic / English text plus math
symbols, fine-tuned on the saeidseyfi/khattat dataset (line crops,
input 32x256, max 88 label chars).
Results (test split, 372-400 line samples)
- test CER: 0.8364
- exact-match: 0.0000
- CER per language: {"en": 0.8494, "fa": 0.8247}
- training: 2110 iterations, batch 12, CPU (2-core) budget fine-tune; decoder+head trained, STR backbone frozen
The training pipeline is time-budgeted and fully resumable — continuing on a GPU with the same script converges substantially further.
Files
best.pt-- model checkpoint (state dict + vocab)vocab.txt-- 176-char vocabulary (fa / ar / en / digits / math)demo_khattat_parseq.mp4-- demo: test lines, ground truth vs predictioneval_report.json,log.txt,worst_samples.json-- metrics
Usage
import torch
from doctr.models import recognition
vocab = open('vocab.txt').read()
model = recognition.parseq(vocab=vocab, pretrained=False,
input_shape=(3, 32, 256), max_length=90)
model.load_state_dict(torch.load('best.pt', map_location='cpu')['model'])
model.eval()
Owner: saeidseyfi
Identity and Version
- Repository
- saeidseyfi/khattat-parseq
- Publisher
- Saeid Seyfi
- Task
- Not stated by the source
- Modality
- Other
- Library
- doctr
- Parameters
- Not stated by the source
- Languages
- fa, ar, en
- Revision
- 0d85d2bb1c7b1c0300a38e69344ecc9dde1d509c
- First published
- 2026-09-18
- Last updated
- 2026-09-18
Files and Weights
8 files, 96.7 MB in total. The weights are 1 file totalling 95.9 MB in pt.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| best.pt | Weights | 95.9 MB | 7f409c419f74 |
| eval_report.json | Configuration | 193 B | — |
| worst_samples.json | Configuration | 1.5 KB | — |
| README.md | Documentation | 1.3 KB | — |
| demo_khattat_parseq.mp4 | Other | 807.2 KB | cab351423978 |
| log.txt | Other | 333 B | — |
| .gitattributes | Repository | 1.6 KB | — |
| vocab.txt | Tokenizer | 265 B | — |
License and Download
- License
- cc-by-4.0
- Access
- Open weights, no gate
- Download size
- 95.9 MB
Released by Saeid Seyfi through its official repository on Hugging Face. Read the license.
Memory Requirements
| Precision | Weights in memory |
|---|---|
| As published | 95.9 MB |
Weights only, from the published parameter count; the key-value cache and runtime add to this.
Questions About khattat-parseq
Can I use khattat-parseq commercially?
Yes. khattat-parseq is released under Creative Commons Attribution 4.0. CC BY 4.0 permits sharing and adapting the work, including commercially, provided the creator is credited and changes are indicated.