Skip to content

Commit 5fc20d7

Browse files
davanstrienclaude
andauthored
Add tesseract-ocr.py CPU baseline; fix pp-ocrv6 inference_info key (#74)
- tesseract-ocr.py: Tesseract 5 baseline following the collection contract (config PRs, inference_info with column_name/model_id, same CLI surface). Installs the tesseract binary via apt at startup (not in the default Jobs image); CPU-only, --lang/--psm/--oem exposed, threaded workers. Smoke-tested locally: full OCR round-trip on rendered text + real Britannica pages. - pp-ocrv6.py: write column_name (the key ocr-bench column discovery reads) alongside output_column — previously only the markdown-name heuristic made discovery work, and a non-default --output-column would have matched the pp_ocr_blocks JSON column instead. - README: add tesseract row to the models table. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 7b819bb commit 5fc20d7

3 files changed

Lines changed: 651 additions & 1 deletion

File tree

ocr/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ _Sorted by model size:_
4949

5050
| Script | Model | Size | Backend | Notes |
5151
|--------|-------|------|---------|-------|
52-
| `pp-ocrv6.py` | [PP-OCRv6](https://huggingface.co/collections/PaddlePaddle/pp-ocrv6) | 1.5–34.5M | PaddleOCR (paddle) | **Smallest by far** — classical det+rec pipeline, not a VLM. Three tiers (`--model-tier tiny\|small\|medium`), plain-text output (not markdown). 50 langs. Runs on `t4-small`. Apache 2.0 |
52+
| `tesseract-ocr.py` | [Tesseract 5](https://github.com/tesseract-ocr/tesseract) | n/a (classical) | pytesseract (CPU) | **The legacy baseline** — no GPU at all, runs on `cpu-upgrade`. Plain-text output, `--lang`/`--psm`/`--oem` exposed, 100+ language packs via apt. Apache 2.0 |
53+
| `pp-ocrv6.py` | [PP-OCRv6](https://huggingface.co/collections/PaddlePaddle/pp-ocrv6) | 1.5–34.5M | PaddleOCR (paddle) | **Smallest neural** — classical det+rec pipeline, not a VLM. Three tiers (`--model-tier tiny\|small\|medium`), plain-text output (not markdown). 50 langs. Runs on `t4-small`. Apache 2.0 |
5354
| `falcon-ocr.py` | [Falcon-OCR](https://huggingface.co/tiiuae/Falcon-OCR) | 0.3B | falcon-perception | Smallest VLM in collection. #1 on multi-column docs and tables (olmOCR), Apache 2.0 |
5455
| `smoldocling-ocr.py` | [SmolDocling](https://huggingface.co/ds4sd/SmolDocling-256M-preview) | 256M | Transformers | DocTags structured output |
5556
| `surya-ocr.py` | [Surya OCR 2](https://huggingface.co/datalab-to/surya-ocr-2) | 0.65B | vLLM | **Structured** OCR + `--task layout\|table`: per-block HTML with bboxes & reading order in an extra `surya_blocks` column. 91 langs, top-under-3B on olmOCR-Bench. Modified OpenRAIL-M license. Needs the **pinned** `vllm/vllm-openai:v0.20.1` image |

ocr/pp-ocrv6.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ def build_inference_entry(tier: str, det_model: str, rec_model: str, args_dict:
701701
"rec_accuracy_pct": TIER_REC.get(tier),
702702
"languages": TIER_LANGUAGES.get(tier, ""),
703703
"engine": "paddle_static",
704+
# column_name is the key ocr-bench's column discovery reads; keep
705+
# output_column too for backward compat with existing outputs.
706+
"column_name": args_dict.get("output_column", "markdown"),
704707
"output_column": args_dict.get("output_column", "markdown"),
705708
"blocks_column": "pp_ocr_blocks",
706709
"timestamp": datetime.now(timezone.utc).isoformat(),

0 commit comments

Comments
 (0)