paddleocr returns empty text on German contract pages - the language pack wasn't downloaded
Fixes PaddleOCR returning empty text on German contract pages: set lang='german' so the German model downloads and loads, rerun the pages, and handle mixed-language documents per page. Use when German pages come back blank while other languages work. Not for garbled output or download failures.
TL;DR
PaddleOCR returning empty text on German contract pages means the German language model was never loaded: the default setup recognizes a limited language set, and without the German pack there is nothing to match the words against, so pages come back empty rather than wrong. Set lang='german' (which triggers a one-time model download) and rerun. For mixed-language contracts, run each page with its language or use the multilingual Latin model - but never assume the default covers your document's language.
The query
paddleocr returns empty text on German contract pages - the language pack wasn't downloadedUse this when
- PaddleOCR returns empty strings on German contract pages
- The same code reads English pages fine but German pages come back blank
- First run in a fresh environment with no cached models
Not for
- Garbled but non-empty German output - that is a model-accuracy problem, not a missing pack
- Empty output on all languages - check the image input and installation first
- Download errors for the language pack - a network or proxy problem, fix that layer
Steps
1. Confirm the language setting is the problem
Check what language the OCR instance was created with. If it is the default, German was never in scope - empty output is the expected result, not a malfunction.
from paddleocr import PaddleOCR
ocr = PaddleOCR(lang="german") # not the default
print(ocr.lang)Expected output: the instance reports german, proving the language is now explicitly set.
2. Let the German model download on first use
The first run with lang='german' downloads the detection and recognition models. This needs network access to the model host - in locked-down environments, pre-download the models into the container image or a shared cache instead of relying on first-run download. Expected output: download completes once; subsequent runs start immediately from cache.
3. Rerun OCR on the German pages
Process the German pages with the german-configured instance and check that text comes back. Compare a sample against the visible page text to confirm it is real recognition, not hallucinations.
result = ocr.ocr("seite-01.png")
text = " ".join(line[1][0] for line in result[0])
print(text[:200])Expected output: German words from the contract page, matching what you see in the image.
4. Handle mixed-language documents per page
For contracts mixing German and English pages, detect or declare the language per page and use the matching instance. A single german instance on English pages (or vice versa) degrades both; two instances cost little and keep each language accurate. Expected output: every page processed with its own language, no empty pages from language mismatch.
Tool compatibility
PaddleOCR 2.x+ with lang='german' (also available: 'latin' for Latin-script multilingual). The model download happens on first use per language.
Variant phrasings
- paddleocr empty text German pages language pack
- PaddleOCR lang german not downloaded empty result
- paddleocr returns nothing German contract OCR
- PaddleOCR default language German pages blank
Why it happens
OCR recognition models are language-specific: the recognizer matches image features against character sets and language statistics it was trained on. PaddleOCR ships a default configuration covering a limited set; German umlauts, Eszett, and German word statistics are not in it. With no matching model loaded, the pipeline finds text regions (detection works) but recognizes nothing (recognition has no German model), yielding empty strings instead of errors.
Edge cases / pitfalls
- The 'latin' model covers many Latin-script languages at lower accuracy - fine for a quick triage, not for production German contracts.
- Umlauts (a, o, u) and Eszett are the first casualties of a wrong-language model; spot-check them specifically.
- Model downloads can be large; in air-gapped environments, vendor the model files into the image build.
- PaddleOCR version upgrades can change model file layouts - pin the version and re-verify the download path after upgrading.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst0MembnKy9bh2Hf2Eeg86w