Skip to main content

GOCR — schnelle, kleine deutsche OCR-/Vision-Schicht für Dokumente (CPU, kein GPU): ganzes Dokument → Text + Position (bbox) als JSON. Bilder + PDF.

Project description

GOCR — schnelle, kleine deutsche OCR-/Vision-Schicht (CPU)

Liest ein ganzes Dokument zu Text + Position (bbox) als strukturiertes JSON — ~38 MB, reine CPU, kein GPU. Gedacht als OCR-/Vision-Schicht für (text-only) LLM-Pipelines und als Tooling: präzise Layout-Boxen + Text rein → dein LLM macht Verständnis/Extraktion.

pip install g-ocr           # Bilder: png/jpg/webp/tiff/bmp ...
pip install "g-ocr[pdf]"    # + PDF-Support (optionales Plugin)
import g_ocr
ocr = g_ocr.from_pretrained()
res = ocr.read("dokument.png")            # ein Bild      -> {text, regions:[{text, box, quad, score}]}
doc = ocr.read_document("rechnung.pdf")   # PDF/mehrseitig -> {n_pages, pages:[...], text}

Stärken

  • 🎯 Präzise Bounding-Boxes, ganzes Dokument, Lesereihenfolge → strukturiertes JSON
  • CPU, bis ~16× schneller als EasyOCR — kein GPU
  • 📦 ~38 MB · 🧱 Fraktur-robust · on-prem/DSGVO · 🤖 LLM-ready
  • 🗂️ Bilder (png/jpg/webp/tiff/bmp …) + PDF (bis ~500 Seiten) → ein API-Aufruf, JSON pro Seite

Benchmarks (anerkannte Sets, CPU)

GOCR Benchmarks

Scene-Text (Word Accuracy ↑): IIIT5K 93,2 % · ICDAR2013 94,1 % · ICDAR2015 67,6 % — IIIT5K klar vor EasyOCR (68,2 %).

Dokument-OCR (CER ↓ / BoW ↓) — Harness agentic-ai-forge/ocr-benchmark-2025:

Engine SROIE CER FUNSD CER SROIE BoW FUNSD BoW
PaddleOCR 15,2 20,3 25,8 50,5
GOCR 18,9 22,4 98,9 130,3
EasyOCR 20,4 26,4 81,1 102,1
Tesseract 22,6 32,4 70,2 88,2
OCR.space 44,3 48,2 73,3 84,8

Einordnung: Auf Dokument-CER #2 von 5 — vor EasyOCR, Tesseract & OCR.space, knapp hinter PaddleOCR, bei ~38 MB auf reiner CPU. Beim Bag-of-Words liegt GOCR zurück (Wort-Spacing der aktuellen Gewichte — Roadmap). Fraktur (NewsEye) ≈3× besser als EasyOCR; bei rein-modernem Deutsch führen Spezial-Engines (Umlaut-Lücke). FUNSD = exakte 25 Referenz-Samples, SROIE = 60er-Stichprobe; gescort mit der metrics.py des Referenz-Harness.

CLI

g-ocr dokument.png              # JSON (text + box + quad)
g-ocr rechnung.pdf              # PDF -> JSON je Seite (Plugin: g-ocr[pdf])
g-ocr dokument.png --text-only  # nur Text (Lesereihenfolge)

Links

Lizenz

Apache-2.0 — siehe LICENSE und NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

g_ocr-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

g_ocr-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file g_ocr-0.1.0.tar.gz.

File metadata

  • Download URL: g_ocr-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for g_ocr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f7cdc4c587561cc52922eff44f2faf9e6412df36b08ad2df41d0877837914257
MD5 133f022398579c818420a87a1bf241f8
BLAKE2b-256 d629092d5390072f0bcd3b3900e5906bfbe420a465ce82400b791c90d9cabada

See more details on using hashes here.

Provenance

The following attestation bundles were made for g_ocr-0.1.0.tar.gz:

Publisher: workflow.yml on Keyvanhardani/g-ocr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file g_ocr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: g_ocr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for g_ocr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc64baf4bce7c945067fe2f665f876e68f6f10b4b8310d762a1e141141c410ce
MD5 2a2bd3971261228e8f748bec514501e7
BLAKE2b-256 d4c83f43acf54d32e4220c97a03f5f0b5d9450748767dde5d1943acb191f7fcf

See more details on using hashes here.

Provenance

The following attestation bundles were made for g_ocr-0.1.0-py3-none-any.whl:

Publisher: workflow.yml on Keyvanhardani/g-ocr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page