/ Модель

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

Лицензия
CC BY-NC 4.0
Библиотека
pytorch
Опубликована
24 ноя 2026

D-OCR-preview

Описание изображенийИзображение → текст6 профессий

Модульный конвейер OCR распознаёт печатный и рукописный бенгальский текст на изображениях и страницах PDF.

0скачиваний за 30 дней4лайкавеса обновлены26 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

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

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

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

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

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

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

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

D-OCR Preview — модульный конвейер OCR для печатных и рукописных документов на бенгальском языке, разработанный проектом D-OCR. В репозитории собраны четыре компонента: детектор областей документа Project Layout-S, распознаватель структуры таблиц Project Table Transformer, детектор текста PP-OCRv5 mobile и распознаватель на основе SigLIP2/Qwen. Система принимает изображения и PDF и возвращает распознанный текст и HTML; также выполняет подготовку фрагментов, упорядочивание областей чтения и восстановление таблиц.

Модель предназначена для разработчиков и исследователей, тестирующих OCR на собственных бенгальских документах. Проверялись печатные страницы, рукописный текст, таблицы и формы. Для интерактивной работы рекомендуется NVIDIA GPU; обработка на CPU доступна, но медленная. Это предварительная версия под лицензией CC BY-NC 4.0.

Распознавание может пропускать, искажать или повторять текст; мелкие и низкокачественные символы сложны для системы. Порядок чтения и восстановление таблиц экспериментальны, распознавание ограничено 200 строками на страницу, а качество для других языков и почерков не установлено. Результаты следует проверять перед использованием как достоверной транскрипции.

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

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

Ограничения

Текст может быть искажён, пропущен или повторён; порядок чтения и восстановление таблиц остаются экспериментальными. Обработка на CPU медленная, а качество для других языков и разнообразных почерков не подтверждено.

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

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

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

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

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

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

Открыть на Hugging Face

D-OCR Preview - A Complete OCR pipline for Bangla handwritten and printed document

All four model components are included: the project layout checkpoint, project table-structure checkpoint, pretrained text detector, and trained SigLIP2/Qwen recognizer. This repository distributes the complete inference pipeline.

D-OCR is a modular Bangla OCR framework that combines document layout detection, text detection, table structure recognition and text recognition.

This release is intended for developers and researchers to test on their own Bangla documents and share feedback. A compatible NVIDIA GPU is recommended for interactive testing. CPU inference is supported, but it is currently slow, especially for long documents. Improving CPU efficiency is a development priority; this preview does not include a quantized or otherwise CPU-optimized recognizer.

What is included

This is a multi-model framework, not a single standalone OCR checkpoint:

ComponentIncluded weightsRole
Project Layout-S checkpointinference.pdiparamsDetect document regions and support reading order
Project Table Transformer checkpointmodel.safetensorsRecover table structure and cell geometry
Pretrained PP-OCRv5 mobile text detectorinference.pdiparamsLocate text for crop preparation
Trained SigLIP2 + connector + Qwen text recognizerbest.ptRead text crops and table-cell text

The pipeline handles crop preprocessing, layout-aware reading order, table reconstruction and text/HTML outputs. All weights and configuration assets are included. The API accepts images and PDFs and loads models locally.

See the pipeline on real documents

The left image is the input; the right image is the actual detection overlay. Blue boxes mark text regions, red numbers show output reading order, and orange boxes mark the recovered table region and cells. These are model outputs, with no manually corrected boxes or transcriptions.

Printed Bangla page

Input imageDetected text regions and reading order
Input: clean printed Bangla pageOutput: 32 numbered text regions on the printed page

The pipeline returned 32 text regions. Detection does not imply perfect OCR: repetition stopping was triggered for two blocks in this run. Read the uncorrected OCR text.

Older, low-resolution print

Input imageDetected text regions and reading order
Input: aged Bangla book page with a poem and proseOutput: 25 numbered text regions on the old printed page

The pipeline returned 25 text regions, including short poem lines and dense prose. Small or degraded glyphs remain difficult to recognize. Read the uncorrected OCR text.

Handwritten Bangla page

Input imageDetected text regions and reading order
Input: handwritten Bangla proseOutput: 13 numbered text regions on the handwritten page

The pipeline returned 13 text regions and 554 text characters. Some boxes overlap; the example demonstrates execution and segmentation, not perfect layout or transcription accuracy. Read the uncorrected OCR text.

Table structure and cell text

Input table cropDetected table cells and remaining text regions
Input: manually selected catalogue table cropOutput: orange cell boundaries and blue text boxes in the catalogue crop

This is a manually selected table crop, processed in table mode. The model recovered 10 cells and recognized cell text. It does not demonstrate automatic table localization on a full page. Some fallback text is duplicated in the raw result, so table reconstruction still needs review. Read the uncorrected OCR text.

Uploaded government form

Input imageDetected text and image regions
Input: uploaded Bangladesh government form with printed and handwritten entriesOutput: numbered text boxes and preserved image regions on the uploaded form

The published pipeline returned 87 text regions and 4 regions classified as images on this uploaded document. Blue boxes show text, green boxes show image regions, and red numbers show output order. This is the unmodified model overlay. No semantic table grid was recovered in this page-mode run; the printed form lines are part of the input image. Read the uncorrected OCR text.

Document types tested

Document / input typeTest coverage and observed limits
Clean printed Bangla pagesCurrent published pipeline; input and 32-region output shown above. OCR errors and repetition stopping remain possible.
Aged or low-resolution printed pagesCurrent published pipeline; input and 25-region output shown above. Small glyphs remain difficult.
Handwritten Bangla proseCurrent published pipeline; input and 13-region output shown above, plus handwritten word/line evaluation in the 448-crop comparison.
Table and catalogue cropsCurrent pipeline recovered 1, 10 and 4 cells in three earlier selected crops; the refreshed 10-cell example is shown above. This is not a table-accuracy benchmark.
Forms mixing print, handwriting, stamps and signaturesEarlier seven-image web-app test; text was processed, but a semantic table grid was not detected.
Dense or stylized handwritingEarlier seven-image test; some lines merged or were missed, with substantial recognition errors.
Tilted diary photos with mixed Bangla/English and occlusionEarlier seven-image test; detection ran, while dates, English text and handwriting remained inaccurate.
Decorative calligraphyEarlier seven-image test; text regions were detected, but the recognized words were wrong.
Image uploads and multi-page PDFsUpload, page rendering, authentication and persistence have automated coverage. PDF routing tests use a stub evaluator and do not establish real-document OCR accuracy.

Getting started

  • Files needed: Download only Dockerfile.gpu + compose.gpu.yml (GPU) or Dockerfile.cpu + compose.cpu.yml (CPU), then follow USER_GUIDE.md.
  • Automatic setup: Docker downloads and verifies all model assets and the compiled Linux x86-64 / CPython 3.12 runtime during the build.
  • No manual steps: No host Python installation, source checkout, or manual weight download is needed.
  • Offline inference: Downloads are cached, so inference runs offline afterward.
  • Not included: The original browser frontend and Python application source. The /docs page provides a browser API testing interface instead.

Create API key

Create your private .env API key as shown in the USER_GUIDE.md, then start the service:

Run docker

# NVIDIA GPU
docker compose -f compose.gpu.yml up -d --build --wait --wait-timeout 600
# CPU
docker compose -f compose.cpu.yml up -d --build --wait --wait-timeout 600

Using the Swagger UI

  • Open http://localhost:8000/docs.
  • Click Authorize, paste your API key, then click Authorize and Close. You need to do this again after any page refresh.
  • Click POST /v1/ocr to expand it, then click Try it out.
  • Under Request body there's an image field with a Choose File button. Click it and pick your image (PNG or JPG) or PDF from your computer.
  • Click Execute.
  • Scroll down to Server response. You want 200 and the OCR result in JSON.
  • Results include:
    • Extracted text
    • Region and table geometry
    • Original-layout HTML
    • Reading-order HTML
  • The guide shows how to save and open both HTML views.
  • Note: Reconstructions follow the backend's layout algorithm but are approximate. Fonts, spacing, and detected structure may differ from the input.

Using the Python script

  • Create a script named ocr.py
        import json
        import os
        import sys
        from pathlib import Path
        
        import requests
        from dotenv import load_dotenv
        
        API_URL = "http://localhost:8000/v1/ocr"
        
        # Load the .env that sits next to this script (utf-8-sig tolerates a BOM)
        load_dotenv(Path(__file__).with_name(".env"), encoding="utf-8-sig")
        
        
        def read_api_key() -> str:
            keys = os.getenv("OCR_API_KEYS")
            if not keys:
                sys.exit("OCR_API_KEYS not found in .env or environment")
            return keys.split(",")[0].strip()
        
        
        def main() -> None:
            if len(sys.argv) < 2:
                sys.exit("Usage: python ocr.py <image-or-pdf> [output.json]")
        
            file_path = Path(sys.argv[1])
            out_path = Path(sys.argv[2] if len(sys.argv) > 2 else "ocr-result.json")
            if not file_path.is_file():
                sys.exit(f"File not found: {file_path}")
        
            with file_path.open("rb") as f:
                resp = requests.post(
                    API_URL,
                    headers={"X-API-Key": read_api_key()},
                    files={"image": (file_path.name, f)},
                    timeout=1800,  # CPU inference can be slow
                )
        
            print(f"HTTP {resp.status_code}")
            if not resp.ok:
                sys.exit(resp.text)
        
            out_path.write_text(
                json.dumps(resp.json(), ensure_ascii=False, indent=2), encoding="utf-8"
            )
            print(f"Saved response to {out_path}")
        
        
        if __name__ == "__main__":
            main()
    
    
  • How to run ocr.py in windows:
      python3 -m venv .venv
      source .venv/Scripts/activate
      pip install requests python-dotenv
      python ocr.py "C:\path\to\test_bangla.png"
      python ocr.py "C:\path\to\doc.pdf" doc-result.json
    
  • How to run ocr.py in linux:
      python3 -m venv .venv
      source .venv/bin/activate
      pip install requests python-dotenv
      python ocr.py ~/images/test_bangla.png
      python ocr.py ~/docs/doc.pdf doc-result.json  
    

Model loading

  • The recognizer is a custom architecture, so AutoModel.from_pretrained(...) cannot currently load best.pt as a complete OCR framework.
  • Use the bundled runtime for end-to-end inference.
  • No training or separate base-model download is needed.

Coming soon

  • Support for llama.cpp, vLLM, OpenVINO, and ONNX Runtime.

Validation scope

The GPU recognition metrics below were measured with the local Python runtime on an RTX 5060 Ti with 16 GB VRAM. CPU inference has also been exercised through the compiled API. The staged compiled runtime and exported weights additionally passed GPU warmup and a real-page check (13 blocks, text and both HTML views). GPU-container execution has not yet been validated on this host, which does not have NVIDIA Container Toolkit. See VALIDATION.md for the exact standalone release checks and their status.

Local evaluation

The following is a local comparison on a fixed cohort of 448 labeled crops. It measures crop recognition, not end-to-end page or table accuracy.

MetricPrevious VCA recognizerPreview SigLIP2/Qwen recognizer
Character error rate9.57%4.90%
Word error rate23.45%14.53%
Exact crop match67.63%78.57%
Inference failures0 / 4480 / 448
Mean time per crop on the test GPU0.078 s0.203 s

Measurements used an RTX 5060 Ti, four CPU threads and a caller cap of 512 output tokens. Model-loading time is excluded. Each backend retained its own crop-reading strategy: short spans for VCA, whole crops for the new recognizer. CER uses NFC-normalized Unicode code points; WER uses whitespace-separated words.

The cohort has been used in earlier project evaluation. Training manifests establishing independence from the supplied checkpoint's training data are not available in this release preparation. These numbers must not be interpreted as certified unseen-test performance, benchmark leadership or a general accuracy guarantee.

Performance varies by source. The new recognizer's CER was 12.62% on 32 external printed lines; WER was 27.83% on 64 BN-HTRD handwriting lines. The overall score therefore does not represent every document type equally.

In one CPU web-service test, a page producing 13 text blocks took approximately 80 seconds. The OCR container's peak cgroup memory was approximately 6.52 GiB, including charged file cache. These are single-sample measurements on the test PC, not minimum hardware requirements or throughput predictions for other CPUs.

Current limitations

  • CPU performance is limited. Multi-page PDFs and dense pages may take substantial time. The current service processes one inference job at a time.
  • Layout detection, reading order and table reconstruction remain experimental. Regions may be missed or assigned an incorrect order; tables may not yield a valid grid. Successful runtime checks do not establish table/grid accuracy.
  • The inherited page pipeline applies OCR to at most 200 detected lines. Review returned warnings on dense pages.
  • Text can be misread, omitted or repeated. Crop-dependent generation limits can truncate output. Repetition stopping can also shorten legitimate repeated text.
  • Detection scores are not calibrated text-recognition confidence scores.
  • The evaluation emphasizes Bangla. Broad multilingual performance, arbitrary mathematical notation and every handwriting style are not established.
  • Default API upload limits are 16 MiB per file, 20 PDF pages, 144 DPI PDF rendering, and 20 megapixels per page.
  • APIs, dependency pins and packaging may change during the preview period.

Review OCR output before using it as an authoritative transcription.

Development priorities

  • Improve CPU latency and memory efficiency.
  • Broaden independent evaluation of page layout, tables and text recognition.
  • Improve reliability on difficult handwriting and dense document layouts.
  • Simplify installation and provide a cleaner package interface.

Upstream components include SigLIP2, Qwen3.5, PaddleOCR/PaddleX and Table Transformer. Upstream licenses and notices are retained in THIRD_PARTY_NOTICES.md and licenses/.

Release license

D-OCR's own trained weight contributions and documentation use CC BY-NC 4.0. The compiled first-party framework runtime uses PolyForm Noncommercial 1.0.0. Noncommercial evaluation and research are permitted under those terms; commercial use requires separate permission. Third-party assets retain their upstream licenses. Read LICENSE and THIRD_PARTY_NOTICES.md for the scope and complete license texts. This is a noncommercial preview.

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

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

GPU в ailist

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

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

Подбираем GPU…

Ревизия весов
84b51dd

0 моделей