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)
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
- 🤗 Modell + Card: https://huggingface.co/Keyven/g-ocr
- 🖥️ Demo: https://huggingface.co/spaces/Keyven/GOCR-Demo
- 🌐 https://german-ocr.de
Lizenz
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7cdc4c587561cc52922eff44f2faf9e6412df36b08ad2df41d0877837914257
|
|
| MD5 |
133f022398579c818420a87a1bf241f8
|
|
| BLAKE2b-256 |
d629092d5390072f0bcd3b3900e5906bfbe420a465ce82400b791c90d9cabada
|
Provenance
The following attestation bundles were made for g_ocr-0.1.0.tar.gz:
Publisher:
workflow.yml on Keyvanhardani/g-ocr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
g_ocr-0.1.0.tar.gz -
Subject digest:
f7cdc4c587561cc52922eff44f2faf9e6412df36b08ad2df41d0877837914257 - Sigstore transparency entry: 1863249661
- Sigstore integration time:
-
Permalink:
Keyvanhardani/g-ocr@d6a34fd281972726f319e6ab429fa81f8a2d09a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Keyvanhardani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@d6a34fd281972726f319e6ab429fa81f8a2d09a8 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc64baf4bce7c945067fe2f665f876e68f6f10b4b8310d762a1e141141c410ce
|
|
| MD5 |
2a2bd3971261228e8f748bec514501e7
|
|
| BLAKE2b-256 |
d4c83f43acf54d32e4220c97a03f5f0b5d9450748767dde5d1943acb191f7fcf
|
Provenance
The following attestation bundles were made for g_ocr-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on Keyvanhardani/g-ocr
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
g_ocr-0.1.0-py3-none-any.whl -
Subject digest:
fc64baf4bce7c945067fe2f665f876e68f6f10b4b8310d762a1e141141c410ce - Sigstore transparency entry: 1863249858
- Sigstore integration time:
-
Permalink:
Keyvanhardani/g-ocr@d6a34fd281972726f319e6ab429fa81f8a2d09a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Keyvanhardani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@d6a34fd281972726f319e6ab429fa81f8a2d09a8 -
Trigger Event:
release
-
Statement type: