azerbaijani-ocr / README.md
multimodalart's picture
multimodalart HF Staff
Upload folder using huggingface_hub
bfcdf0a verified
|
Raw History Blame Contribute Delete
2.36 kB

A newer version of the Gradio SDK is available: 6.31.0

Upgrade
metadata
title: Azerbaijani OCR — CRNN + CTC
emoji: 📜
colorFrom: purple
colorTo: indigo
sdk: gradio
sdk_version: 6.28.0
app_file: app.py
short_description: Read Azerbaijani text lines and whole page scans
python_version: '3.12'
startup_duration_timeout: 1h

Azerbaijani OCR — CRNN + CTC

A Gradio demo for LocalDoc/azerbaijani-ocr-crnn, an 8.5M-parameter CRNN + CTC recogniser for Azerbaijani print in Latin and Cyrillic script (CER 0.0242 / WER 0.0565 on the authors' benchmark).

Two modes:

  • Line — the recogniser alone on a cropped line of text. This is the model's native input.
  • Page — PP-OCRv5 detection finds the line boxes, the recogniser reads each crop. Reading order assumes a single column; for two-column pages, read the left half and then the right half using the Column layout option.

modeling.py and the detection / reading-order logic are vendored verbatim or adapted from the model repo (CC-BY-4.0); the weights (model.pt) are downloaded from the Hub at startup.

Limitations

From the model card, and worth knowing before you judge an output:

  • a ↔ ə. Training labels came from OCR text layers rather than human transcription, so the model inherited that engine's systematic errors. The most common residual mistake is printing a where the page shows ə.
  • Resolution floor. Source lines run about 20 px high; at that scale the Cyrillic vertical-stroke family (и/н/п/м) is genuinely ambiguous.
  • Greedy CTC decoding — no language model.
  • The Cyrillic benchmark figure rests on a small number of books and is optimistic.
  • Very large pages (roughly 30+ detected lines) can exhaust the shared ZeroGPU memory pool while batching. The recogniser halves its batch and retries automatically, so those pages still finish, but a very dense page may take noticeably longer or fail on a busy worker — split it if that happens.

Example assets

Line and page examples are real crops from LocalDoc/azerbaijani-ocr-benchmark (CC-BY-4.0, © LocalDoc), the authors' own evaluation set. The page examples stack consecutive benchmark lines into a full-page layout.