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 — ~30 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}
Node / JavaScript (npm install g-ocr):
const gocr = require("g-ocr");
const ocr = await gocr.fromPretrained();
const res = await ocr.read("dokument.png"); // { text, regions:[{ text, box, quad, score }] }
Stärken
- 🎯 Präzise Bounding-Boxes, ganzes Dokument, Lesereihenfolge → strukturiertes JSON
- ⚡ CPU, bis ~16× schneller als EasyOCR — kein GPU
- 📦 ~30 MB (Detektor ~12 + Recognizer ~18) · 🧱 Fraktur-robust · on-prem/DSGVO · 🤖 LLM-ready
- 🗂️ Bilder (png/jpg/webp/tiff/bmp …) + PDF (bis ~500 Seiten) → ein API-Aufruf, JSON pro Seite
Benchmarks (deutsche Eval-Sets, CPU)
KSVTRv3-de — deutscher Recognizer, eigene deutsche Eval-Sets (NED ↑ = Zeichen-Ähnlichkeit, höher = besser):
| Set | NED ↑ | ~CER |
|---|---|---|
| Modernes Deutsch (clean) | 0,91 | ~9 % |
| Degradierte Scans (Augraphy) | 0,85 | ~15 % |
| Fraktur (NewsEye, real) | 0,74 | ~26 % |
KSVTRv3-de ist ein deutscher Spezialist — robust auf echten/verrauschten Scans und Fraktur (Augraphy-Realismus im Training), trainiert auf deutschen Korpora (Leipzig) + Domänenfeldern (Rechnung/IBAN/USt-IdNr) + 2642 Dokument-Fonts. Auf sauberem modernem Deutsch sind dedizierte Engines (z. B. Tesseract) bei reiner Zeichengenauigkeit teils vorn; GOCRs Stärke ist die robuste, on-prem, integrierte Dokument→JSON-Schicht (CPU, klein, LLM-ready).
Architektur
GOCR-Detektor (DB-basiert) + KSVTRv3-de-Recognizer (SVTR-Encoder + CTC, deutscher Charset) — reines ONNX/CPU.
So entsteht der deutsche Recognizer (Daten-Foundation → Training → Deploy):
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
Credits & Upstream
GOCR baut auf hervorragender Open-Source-Arbeit auf (jeweils Apache-2.0):
- OpenOCR (Topdu/OpenOCR) — Detektor (DB) + Recognizer (RepSVTR / SVTR-Familie) + Trainings-Framework.
- PaddleOCR (PaddlePaddle/PaddleOCR) — Zeichen-Dictionary (
ppocr_keys_v1).
Beide stehen unter Apache-2.0; die Lizenz- und Urheberhinweise gelten fort (siehe NOTICE).
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.2.0.tar.gz.
File metadata
- Download URL: g_ocr-0.2.0.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0271da5084dec14ca1b33718be5baf99da6802eb7a8bf50b9df2f60ac3d17fa8
|
|
| MD5 |
09ea6726218fe5be838988140b43bac2
|
|
| BLAKE2b-256 |
9779cab4d4f9214b5761014016b6e752b33caad389e0f0e37e2a253199ff6e13
|
Provenance
The following attestation bundles were made for g_ocr-0.2.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.2.0.tar.gz -
Subject digest:
0271da5084dec14ca1b33718be5baf99da6802eb7a8bf50b9df2f60ac3d17fa8 - Sigstore transparency entry: 1870863254
- Sigstore integration time:
-
Permalink:
Keyvanhardani/g-ocr@cf711071c9e48ddd06de02fb88d2985eae17f84d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Keyvanhardani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@cf711071c9e48ddd06de02fb88d2985eae17f84d -
Trigger Event:
release
-
Statement type:
File details
Details for the file g_ocr-0.2.0-py3-none-any.whl.
File metadata
- Download URL: g_ocr-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.9 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 |
3c171fb6171fa14eaf7e31a4fa00727a67c9def8231150cd37d6e569c66b14a3
|
|
| MD5 |
8764591213312ff725f9d6a440a556d8
|
|
| BLAKE2b-256 |
5467e962797036bbf7de5c31c50d4f8d7e0633369f6c4ceefbfce2f36cf8b63f
|
Provenance
The following attestation bundles were made for g_ocr-0.2.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.2.0-py3-none-any.whl -
Subject digest:
3c171fb6171fa14eaf7e31a4fa00727a67c9def8231150cd37d6e569c66b14a3 - Sigstore transparency entry: 1870863260
- Sigstore integration time:
-
Permalink:
Keyvanhardani/g-ocr@cf711071c9e48ddd06de02fb88d2985eae17f84d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/Keyvanhardani
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@cf711071c9e48ddd06de02fb88d2985eae17f84d -
Trigger Event:
release
-
Statement type: