B.L.A.S.T. OCR
Code Executed & Verified, 2026-09-10

High-Throughput PDF OCR in Python: RapidOCR's 7.7x Speedup Over EasyOCR

Primary query: high throughput pdf ocr python · raw markdown

What is the fastest Python OCR library for PDFs?

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.

MetricRapidOCR (current default)EasyOCR (previous)Phase-0 (Tesseract-backed)
Mean CER0.19160.23380.4992
Mean WER0.47390.49680.7288
Reading Order τ0.97580.9641n/a
Avg. CPU latency/page~15.3s~117.8sn/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

  1. Vectorize image normalization — batched NumPy/SIMD-friendly operations instead of a per-image Python loop (batch_preprocessor.py).
  2. 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.
  3. Stream pages through a bounded buffer so batching doesn't trade memory for speed (see the memory leak prevention guide).

Author & Engineering Authority

Engineered & maintained by Ibrahim Salman, Full-Stack Software Engineer & AI Systems Architect (UET Taxila).