Tools,

PaddleOCR on ONNX Runtime, tested

4.3x

faster than Paddle on a Mac CPU

Get the code

Same 1,899 words, a quarter of the time

Ten scanned book pages, 1,955 words. PP-OCRv5 mobile, English recognizer, a Mac CPU, 2 threads.

Words of 1,955, time a page
Setup Words Time
PaddleOCR, Paddle engine 1,899 14.7 s
PaddleOCR, official ONNX files 1,899 3.4 s
PaddleOCR, our paddle2onnx files 1,899 4.3 s
RapidOCR, its own ONNX files 1,904 2.9 s

The three PaddleOCR runs gave the same text, byte for byte. Memory peaked at 3.7 GB on Paddle and 2.9 GB on ONNX.

The PaddleOCR team measured a similar gap, and a small one on Intel:

Two packages, no paddlepaddle

pip install paddleocr onnxruntime
from paddleocr import PaddleOCR

ocr = PaddleOCR(
    engine="onnxruntime",
    engine_config={"intra_op_num_threads": 2},
    text_detection_model_name="PP-OCRv5_mobile_det",
    text_recognition_model_name="en_PP-OCRv5_mobile_rec",
    use_doc_orientation_classify=False,
    use_doc_unwarping=False,
    use_textline_orientation=False,
)
for res in ocr.predict("page.jpg"):
    print("\n".join(res["rec_texts"]))

Set threads in engine_config, not cpu_threads

With engine="onnxruntime", PaddleOCR 3.7.0 drops cpu_threads. Both sessions got 0, which lets ONNX Runtime pick its own count.

engine_config={"intra_op_num_threads": 2}, as in the code above, gave both sessions 2.

Two errors, and what they mean

Convert a model yourself with paddle2onnx

For a fine-tuned model, or one with no official ONNX copy. This step needs paddlepaddle, and Python 3.12 or older.

First run the PaddleOCR call above once without the two engine lines. That downloads the Paddle models to ~/.paddlex/official_models.

# Python 3.12 or older: paddle2onnx 2.1.0 has no wheel for 3.13
pip install paddlepaddle paddleocr paddle2onnx
M=~/.paddlex/official_models
for m in PP-OCRv5_mobile_det en_PP-OCRv5_mobile_rec; do
  mkdir -p onnx/$m
  paddle2onnx --model_dir $M/$m --model_filename inference.json \
    --params_filename inference.pdiparams \
    --save_file onnx/$m/inference.onnx --opset_version 11
  cp $M/$m/inference.yml onnx/$m/
done

Then load your files in PaddleOCR

Add two lines to the PaddleOCR call above:

text_detection_model_dir="onnx/PP-OCRv5_mobile_det",
text_recognition_model_dir="onnx/en_PP-OCRv5_mobile_rec",

CoreML broke the text

The Mac onnxruntime wheel ships the CoreML provider. I turned it on with providers in engine_config, on the first 2 pages.

Words found of 381, and time a page
Provider Words Time
CPU 360 3.6 s
CoreML, then CPU 23 14.3 s

CoreML also peaked at 11 GB of memory. Stay on the CPU. I did not dig into why.

RapidOCR is the other ONNX route

Or skip the install

PDF OCR to Markdown, our Apify Actor, reads a scanned PDF by URL and returns Markdown or text.

What I did not test

How I tested it
  • A Mac with Apple M5 Max, macOS 26.6, and the versions below.
  • The scan: 10 proofread pages from two public domain books on Wikisource, 1920 px JPEGs. Score: true words found in order.
  • PaddleOCR ran with its three page-fix models off. One run at a time, 2 threads, at low priority.
  • The timed runs also set inter_op_num_threads to 1. Python 3.13, or 3.12 for paddlepaddle and paddle2onnx.
  • Times are rough: the Mac ran other work too. The Paddle run started at the lowest load of any run, our export at the highest.
  • Scripts and results stay in our private repo, in research/bench/paddleocr-onnx-2026-11-25/.
Package Version
paddleocr 3.7.0
onnxruntime 1.32.0
paddlepaddle 3.3.1
paddle2onnx 2.1.0
rapidocr 3.10.0

Questions people ask

Does PaddleOCR support ONNX?

Yes. Since 3.7.0, pass engine="onnxruntime" and PaddleOCR downloads ONNX copies of the models from PaddlePaddle on Hugging Face. The old 2.x versions had use_onnx, with ONNX files you bring.

Do I need paddlepaddle to run PaddleOCR ONNX models?

Not to run them: paddleocr and onnxruntime are enough. You need paddlepaddle to convert a model yourself with paddle2onnx.

Is the ONNX output the same as Paddle's?

On our 10 pages, yes. The official ONNX files and our own export gave the same text as the Paddle engine, byte for byte.

Can PaddleOCR ONNX use CoreML on a Mac?

Not well in our test. With the CoreML provider, the same models found 23 of 381 words, where the CPU found 360.