/ Модель

Характеристики

Лицензия
Apache 2.0
Базовая модель
Qwen3-VL-2B-Instruct
Библиотека
gguf
Опубликована
27 ноя 2026

urdu-nastaliq-ocr-qwen3vl-2b-GGUF

Изображение и текст → текст8 профессий
785скачиваний за 30 дней0лайковвеса обновлены28 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Локальная модель на базе Qwen3-VL-2B для распознавания печатного и рукописного текста на урду, включая шрифт насталик.

OmgItsAmmer/urdu-nastaliq-ocr-qwen3vl-2b-GGUF — модель распознавания текста на изображениях, созданная дообучением Qwen3-VL-2B-Instruct с помощью LoRA. Она принимает фотографии и сканы печатного текста и рукописи на урду и возвращает распознанный текст письмом урду; особенно ориентирована на шрифт насталик. Модель распространяется в формате GGUF для llama.cpp с вариантами Q8_0 и Q4_K_M и может работать локально на CPU без подключения к интернету.

В тестах авторов версия v3 показала низкую частоту ошибок на рукописных и печатных примерах, включая страницы новостей. Для мелкого текста рекомендуется увеличить изображение так, чтобы высота букв составляла около 48 пикселей. Результаты зависят от качества и размера изображения, а отдельные примеры показывают возможные ошибки распознавания. Репозиторий указывает лицензию Apache 2.0.

Сценарии применения

  • распознавание текста на урду в фотографиях и сканах
  • оцифровка рукописных записей на урду
  • распознавание печатных строк и страниц на урду
  • извлечение текста насталик из изображений
  • локальное распознавание текста в документах без отправки в облако

Ограничения

Для мелких букв желательно предварительно увеличить изображение примерно до высоты букв 48 пикселей. Возможны ошибки в распознавании слов и пунктуации; приведённые метрики получены на тестовом наборе авторов и не гарантируют качество на других данных.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображение → текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

Для каких профессий подходит8

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Urdu Nastaliq OCR: Qwen3-VL-2B (v3), GGUF

Files

FileSizePurpose
urdu-ocr-2b-v3-Q8_0.gguf1.83 GBRecommended language model (8-bit)
urdu-ocr-2b-v3-Q4_K_M.gguf1.11 GBSmaller language model (4-bit)
urdu-ocr-2b-v3-mmproj-f16.gguf0.82 GBVision projector, required by both
lora-adapter/0.20 GBv3 LoRA adapter (r=32, alpha=64) for Qwen3-VL-2B-Instruct (continues from v1 and v2 rounds)

Download:

hf download OmgItsAmmer/urdu-nastaliq-ocr-qwen3vl-2b-GGUF urdu-ocr-2b-v3-Q8_0.gguf urdu-ocr-2b-v3-mmproj-f16.gguf --local-dir .

What it does

You give it a photo or scan of Urdu text: a printed line, a page, or handwriting. It gives back the text in Urdu script. It runs entirely on a CPU, with no internet and no API key. The model is Qwen3-VL-2B fine-tuned with LoRA and shipped as GGUF for llama.cpp (Q8_0 1.8 GB, Q4_K_M 1.1 GB).

Why we built it

Urdu is read by about 230 million people and is mostly written in Nastaliq, where letters join and words slope down to the left. That breaks most OCR tools:

  • Tesseract's Urdu model is far off on our handwriting and printed-line tests (see the table).
  • Base Qwen3-VL-2B often doesn't stop: it loops until the token limit, so its error rate is over 100% on pages.
  • The released Urdu OCR model we compared against (Qaari 0.1) fails on photos unlike its training fonts: it over-writes badly on typeset pages.

A small model taught this one task can beat all three and is cheap enough to run locally, which keeps private documents on the device.

How it was built: three rounds

RoundAddedExamplesTime on 1x RTX 3090Peak VRAM (reserved)
v1synthetic Nastaliq lines (one font), news pages, tablet handwriting82,6705.4 h18.0 GB
v2the same data re-rendered as photos: handwriting on ruled notebook paper, lines stacked into multi-line pages; continues from v122,3662.6 h17.8 GB
v3a second typeface (Noto Nastaliq Urdu, OFL) as lines and pages; continues from v225,5691.9 h11.4 GB

Common setup: Qwen/Qwen3-VL-2B-Instruct, LoRA r=32 / alpha=64 on all linear layers (language model and vision), bf16, batches packed by token budget, max length 2,560 tokens, transformers 5.24, PEFT 0.22, torch 2.14. v3 final eval loss 0.127 (v2: 0.146). Configs are in configs/.

Two findings did most of the work:

  1. Letter size. Qwen-VL reads images in 32-pixel patches, and Nastaliq letters in small images are too small to see. On one 13-line typeset page CER went from 163% (a repeating loop) to about 12%, and on one notebook handwriting photo from 54% to 8% (single images, scored against our own transcriptions), just by enlarging the image until letters are about 48 px tall. We measure letter height from the connected ink blobs (ruled lines removed) and enlarge only when needed. No training involved.
  2. Broken letters teach guessing. About a third of the synthetic source lines are eroded, with missing letter pieces, while their labels list every letter. Training on them taught the model to guess common words for letters it could not see ("آسمان" became "آسان"). The page data in v2 and v3 keeps only solid-ink lines.

Output cleanup: repeated words (4+ times in a row) or characters (30+ times) are collapsed to one copy. It changes 0 of 651 reference texts, so it does not touch normal text.

Data and credits

All training data is openly licensed. Please credit the sources:

SourceLicenceUsed for
PuristanLabs1/urdu-ocr-1M (Nastaliq part)MITsynthetic lines; their texts also rendered by us in Noto Nastaliq Urdu
oddadmix Qaari 0.1 newsMITnews pages
OUHD-L online Urdu handwriting, DOI 10.5281/zenodo.20642162CC BY 4.0tablet handwriting (311 writers, split by writer), re-rendered as notebook photos
Noto Nastaliq UrduSIL OFL 1.1second typeface
1908 book sampleevaluation onlynever trained on; tests old print

Baselines: Qaari 0.1 (oddadmix/Qaari-0.1-Urdu-OCR-VL-2B-Instruct), Tesseract 5 with urd. Base model Qwen3-VL (Apache 2.0). Tools: Hugging Face transformers and PEFT, llama.cpp. Background reading that shaped our approach: Naz et al. 2017; Ul-Hasan et al. 2013; Sabbour and Shafait 2013 (UPTI); Maqsood et al. (unified printed and handwritten Urdu OCR); Riaz et al. (Conv-Transformer).

Run it locally

llama-server -m urdu-ocr-2b-v3-Q8_0.gguf --mmproj urdu-ocr-2b-v3-mmproj-f16.gguf -c 8192 -ngl 0 --jinja

Send an image to /v1/chat/completions with the prompt: Read the Urdu text in this image and write it out exactly, in Urdu script. Keep the original words and punctuation. Output only the text, nothing else. with temperature 0 and repeat_penalty 1.05. For best results enlarge small images first so letters are about 48 px tall (uocr.pages.prepare_for_reading in the code repo). The repo also has a web app that compares models side by side: make demo.

Measured on CPU only (Intel i7-13700KF, 8 threads, no GPU, one request at a time):

Q8_0 (1.8 GB)Q4_K_M (1.1 GB)
RAM, peak5.6 GB5.6 GB
One handwritten lineabout 3.5 sabout 2.7 s
1-5 printed linesabout 31 sabout 24 s
13-line typeset pageabout 53 sabout 65 s
CER on our real photos + test lines (19 items)2.8%3.5%

Q8_0 gave the same error rate on CPU and GPU on our real-photo check (3.8%). We have not tested laptops or phones. Older laptop CPUs will be slower; treat anything beyond this desktop as an estimate.

Results

Character error rate (CER) and word error rate (WER), in percent, lower is better. These are the 362 test items that every system was run on, so the comparison is like for like:

Test set (items)TesseractBase Qwen3-VL-2BQaari 0.1Qaari + our dataOurs v1Ours v3
Handwriting, unseen writers (200)61.4 / 96.741.5 / 77.1241.3 / 282.110.4 / 31.88.7 / 27.39.2 / 27.7
News pages (87)11.1 / 17.186.2 / 96.56.9 / 8.9 *21.0 / 35.85.7 / 6.45.7 / 6.5
Printed lines, synthetic (24)59.7 / 90.445.8 / 79.071.2 / 107.75.2 / 22.12.8 / 20.63.1 / 18.8
1908 book, never trained on (51)67.1 / 100.985.7 / 114.1194.7 / 217.143.8 / 80.780.1 / 111.034.1 / 73.2
All 36218.7 / 29.482.8 / 96.336.0 / 43.721.7 / 38.611.0 / 15.67.9 / 13.0

* Qaari was trained on this news dataset, so that score is not a held-out result.

Caveats on this table: the printed-line row has only 24 items. Our v1 and v3 runs used the letter-size enlargement described above; the baseline runs did not (the table is not a claim that baselines cannot be improved the same way). All systems have the repetition cleanup applied. v3's extra training did not improve handwriting (9.2 vs 8.7) but helped books and printed pages.

Other v3 results on its own larger test sets (CER / WER): Noto-font pages 1.9 / 9.9, stacked printed pages 6.9 / 23.1, notebook-photo handwriting 11.5 / 32.1. These test sets come from the same generator as the training data, so they are optimistic.

Real photos: the honest test

Three real images, none ever trained on (a printed Nastaliq couplet, a typeset page, a notebook handwriting photo), read through the same app with the same preprocessing. CER / WER:

ImageOurs v3Ours v1Qaari 0.1Qaari + our data
Notebook handwriting11.1 / 35.727.0 / 64.374.6 / 100.020.6 / 35.7
Typeset page3.7 / 16.35.5 / 22.0238.6 / 246.929.6 / 47.4
Printed couplet3.2 / 18.84.8 / 18.831.7 / 75.09.5 / 31.2
All three4.1 / 17.66.7 / 24.3217.9 / 226.828.0 / 45.6

Three images show a direction, not a guarantee.

Examples (v3, Q8_0, CPU)

ImageTrue textv3 outputBase Qwen3-VL-2B
held-out printed lineنجیب رزاق نے انگلستان کے اعلیٰ کالجوں سے تعلیم حاصل کی۔exactly rightتیمیر مسلکِ کے اصل کا بچنے تیزاق نے الگہاتان کے
held-out printed lineمرحلہ 7: باقی تمام فلٹر بیگ کے ساتھ 3-6 قدم دہرائیں۔مرحلہ7: باقی تمام فلسطر بیگ کے ساتھ 3-6 قدم دہرائیں۔مَرْحُلَة 7: باقی تَمَام فَلْسِرِیِ کَے 3-6 تَمَر دِو رَائِتِنَدِي
real photo, coupletکیا تنگ ہم ستم زدگاں کا جہان ہےکیا تنگ ہم ستم زد گاں کا جان ہے
real photo, notebookاور ہو سکتا ہو تمہارا یقین تمہیں معجزوں … جب یقین اللہاور ہوسکتا ہو تمہارا یقین تمہیں مجھروں … جیہ یقین اللّہ

Where it still fails

  • About 1 word in 5 is still wrong on real photos (WER 18-36% on our three), mostly single-letter slips: جہان read as جان, معجزوں as مجھروں. When letters are unclear the model falls back on a common word, which can change the meaning.
  • Dense old print. On the 1908 dictionary pages CER is still 34% and WER 73%; the model loops on numbered entries.
  • Handwriting beyond neat samples is not solved. We have only three real images and no labelled phone-photo test set of useful size.
  • Dense pages are slow on CPU (30-60 s), and we have not tested older laptops or phones.
  • Test sets from our own generator flatter us. Treat the real-photo table as the guide.

Code

Training, evaluation and demo code: https://github.com/OmgItsAmmer/finetune-anywhere/tree/showcase/urdu-nastaliq-ocr/showcase/qwen-local-hackathon-2026/urdu-nastaliq-ocr

Built for the Qwen Local Hackathon 2026. Author: OmgItsAmmer.

Best accuracy: v4-NC (non-commercial)

A fourth training round adds real scanned book lines (UTRSet-Real, CC BY-NC-SA 4.0): 92.18% accuracy on 2,096 real book lines, handwriting CER 8.2%. Research and non-commercial use only: OmgItsAmmer/urdu-nastaliq-ocr-qwen3vl-2b-v4nc-GGUF. This v3 model is the openly licensed release.

Hackathon entry (PR): https://github.com/junaiddshaukat/finetune-anywhere/pull/14

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · gguf

Можно запустить

Подбираем GPU…

Ревизия весов
09159ff

0 моделей