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 prediction
  • eval_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

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