Skip to main content

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.

GOCR Architektur

So entsteht der deutsche Recognizer (Daten-Foundation → Training → Deploy):

GOCR Training-Pipeline

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

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

Apache-2.0 — siehe LICENSE und NOTICE.

Metadata

Release files for g-ocr 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for g-ocr 0.2.0
File Size Uploaded
g_ocr-0.2.0.tar.gz 15.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for g-ocr 0.2.0
File Interpreter ABI Platform
g_ocr-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.5 kB

Release files / g_ocr-0.2.0.tar.gz

Download URL g_ocr-0.2.0.tar.gz
Size 15.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0271da5084dec14ca1b33718be5baf99da6802eb7a8bf50b9df2f60ac3d17fa8
BLAKE2b-256 checksum
How to use checksums
9779cab4d4f9214b5761014016b6e752b33caad389e0f0e37e2a253199ff6e13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.

Transparency log

Release files / g_ocr-0.2.0-py3-none-any.whl

Download URL g_ocr-0.2.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c171fb6171fa14eaf7e31a4fa00727a67c9def8231150cd37d6e569c66b14a3
BLAKE2b-256 checksum
How to use checksums
5467e962797036bbf7de5c31c50d4f8d7e0633369f6c4ceefbfce2f36cf8b63f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page