High-Throughput PDF OCR in Python: RapidOCR's 7.7x Speedup Over EasyOCR
B.L.A.S.T. OCR's default RapidOCR/ONNX Runtime engine processes documents at ~15.3 seconds per page on commodity CPU hardware -- 7.7x faster than the project's own EasyOCR/PyTorch baseline (117.8s/page) -- while cutting mean Character Error Rate by 18% (0.2338 → 0.1916) on a 14-page gold-standard corpus. No GPU throughput has been measured for this project yet; every number below is CPU-only and reproducible.
CLI Quickstart
# No PyPI package published yet -- this is a source install
git clone https://github.com/Ibrahim-Salman19/OCR.git && cd OCR
pip install -r requirements.txt
python -m blast_ocr.cli large_document.pdf --formats md,docx,pdf
Production Python Implementation
from blast_ocr.pipeline import BlastPipeline
# config_overrides accepts any JobConfig field
pipeline = BlastPipeline(config_overrides={"ocr_engine": "rapidocr", "max_workers": 4})
# process_job() returns a plain dict, not an object
result = pipeline.process_job(
source_path="samples/financial_report.pdf",
formats=["markdown", "docx", "pdf"],
)
print(f"Status: {result['status']}")
print(f"Pages Processed: {result['pages_processed']}")
print(f"Generated Markdown: {result['generated_files'].get('markdown')}")
Per-page latency isn't returned inline by process_job() -- it's measured by the reproducible benchmark harness below (python -m eval.run).
Engine bake-off (in-repo, reproducible, 14-page gold corpus)
This compares OCR backends B.L.A.S.T. has actually shipped and measured on the same corpus -- not a claim about Docling, Marker, or AWS Textract, which have not been run against this corpus.
| Metric | RapidOCR (current default) | EasyOCR (previous) | Phase-0 (Tesseract-backed) |
|---|---|---|---|
| Mean CER | 0.1916 | 0.2338 | 0.4992 |
| Mean WER | 0.4739 | 0.4968 | 0.7288 |
| Reading Order τ | 0.9758 | 0.9641 | n/a |
| Avg. CPU latency/page | ~15.3s | ~117.8s | n/a (not measured) |
Source: eval/results/rapidocr_candidate.json, ADR 0005, docs/BENCHMARKS_2026.md. Reproduce with python -m eval.run.
How vectorized SIMD pre-processing works
- Vectorize image normalization — batched NumPy/SIMD-friendly operations instead of a per-image Python loop (
batch_preprocessor.py). - Group pages by aspect ratio before batching, reducing the zero-padding FLOPs that fixed-dimension ONNX tensors otherwise require for mixed portrait/landscape/square pages.
- Stream pages through a bounded buffer so batching doesn't trade memory for speed (see the memory leak prevention guide).