PaddleOCR in Python: what predict() returns, tested
15
single letters from the 2.x loop
txts = [line[1][0] for line in result[0]]
# ['n', 'a', 'o', 't', 'o', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'i', 'e', 'e']
The working 3.x code, tested
from paddleocr import PaddleOCR
ocr = PaddleOCR(
use_doc_orientation_classify=False, # page turn model off
use_doc_unwarping=False, # unwarp model off
use_textline_orientation=False, # line turn model off
cpu_threads=2, # the default is 10
)
results = ocr.predict("scan.pdf") # a list: one result per page
print(type(results).__name__, len(results))
page = results[0]
print(page["page_index"], page["rec_texts"][:3])
print([round(s, 3) for s in page["rec_scores"][:3]])
print(page["rec_boxes"].shape, page["rec_boxes"][0])
It printed:
list 10
0 ['86', 'The Boy Scouts of the Air', '"Keep your head, Hatton," commanded']
[1.0, 0.999, 0.986]
(27, 4) [101 ... 214]
On all 10 pages it found 1,919 of 1,955 words, the same text as PaddleOCR on a Mac.
Each page is a dict with 15 keys
So the 2.x loop gave no error on paddleocr 3.7.0: it walked the 15 keys of a default result and took the second letter of each.
| Key | What it holds |
|---|---|
rec_texts |
27 strings, one a line |
rec_scores |
27 floats, one a line |
rec_boxes |
A NumPy array, 27 by 4: x_min, y_min, x_max, y_max |
rec_polys |
27 arrays of 4 corner points |
page_index |
0 to 9 for a PDF, None for an image or array |
input_path |
The file, None for an array |
The other 9 keys, and two print traps
- doc_preprocessor_res, dt_polys, model_settings, text_det_params, text_type, text_rec_score_thresh, return_word_box, vis_fonts, textline_orientation_angles.
-
After predict, NumPy prints
[101 ... 214]for a box row, in your whole program..tolist()prints every number. -
page.print()writes nothing to stdout. It logs to stderr.
Seven 2.x lines: 4 errors, 1 silent
| 2.x line | What 3.x does | 3.x line |
|---|---|---|
use_angle_cls=True |
Works, with a DeprecationWarning | use_textline_orientation=True |
show_log=False |
ValueError: Unknown argument: show_log |
No 3.7.0 mapping |
use_gpu=False |
ValueError: Unknown argument: use_gpu |
device="cpu", which 3.7.0 accepts |
ocr.ocr(img_path, cls=True) |
TypeError: PaddleOCR.predict() got an unexpected keyword
argument 'cls'
|
ocr.predict(img_path), with
use_textline_orientation=True in
PaddleOCR()
|
ocr.ocr(img_path) |
Works, with a DeprecationWarning | ocr.predict(img_path) |
[line[1][0] for line in result[0]] |
No error, 15 single letters (the first code block) | result[0]["rec_texts"] |
result[0][0][1][0] |
KeyError: 0 |
result[0]["rec_texts"][0] |
3.7.0 still maps 11 old names, like rec_batch_num, with a DeprecationWarning. Python shows these warnings by default only when the line is in the script you run, not in an imported module.
Arrays are read as BGR, PDFs at 144 dpi
| Input | Words | Note |
|---|---|---|
| 144 dpi PNG paths | 585 | Same text as the PDF, 78.8 s |
| 300 dpi PNG paths | 589 | 201.4 s |
BGR arrays, cv2.imread |
585 | Same text as the PDF |
| RGB arrays | 582 | 9 of 81 lines changed |
A list, a loop and predict_iter gave the same text: the pipeline reads one image at a time. Seconds are rough, as other jobs kept the Mac busy.
Flip RGB first: rgb[:, :, ::-1]. For 300 dpi from a PDF,
set PADDLE_PDX_PDF_RENDER_SCALE=4.166666666666667 before
you import paddleocr.
NotImplementedError on x86: turn oneDNN off
This Stack Overflow question had 2,750 views on November 22, 2026. One answer pins older versions; the other turns oneDNN off.
In Docker on linux/amd64, paddlepaddle 3.3.1 stopped on the first page:
NotImplementedError: (Unimplemented) ConvertPirAttribute2RuntimeAttribute not support [pir::ArrayAttribute<pir::DoubleAttribute>] (at /paddle/paddle/fluid/framework/new_executor/instruction/onednn/onednn_instruction.cc:116)
| Change | Result |
|---|---|
PaddleOCR(enable_mkldnn=False) |
Works |
PADDLE_PDX_ENABLE_MKLDNN_BYDEFAULT=False, set
before the import
|
Works |
PaddleOCR(device="cpu") |
The same error |
| paddlepaddle 3.2.0 (paddleocr 3.7.0 kept) | Works, with oneDNN on |
An Apple silicon Mac never shows it: the macOS arm64 wheel has no oneDNN. For Docker: PaddleOCR in Docker.
Downloads again? Check the cache folder
A model folder that exists is used as is, with or without a network. Only a missing model folder makes PaddleOCR download a model.
The folder is ~/.paddlex/official_models/, or the same
under $PADDLE_PDX_CACHE_HOME. A new container without a
volume, or another user, starts empty. One more download: the first
save_to_img() fetches a 10 MB font into fonts/, next to
official_models/.
Missing model, no network, with
PADDLE_PDX_DISABLE_MODEL_SOURCE_CHECK=True:
Exception: Encounter exception when download model from bos. No model source is available! Please check network or use local model files!
Without it:
Exception: No available model hosting platforms detected. Please check your network connection.
Skip the install and the models
PDF OCR to Markdown, our Apify Actor, needs no PaddlePaddle or model download on your machine. Digital pages use the PDF's own text.
- Scanned pages: $0.006 each. Digital pages: free. Plus a $0.00005 start fee a run at the default 1 GB.
- On Apify's free plan, it stops at 20 pages a run and 50 a month.
How I tested it
- Scan: 10 proofread book pages from English Wikisource, 1,955 true words, one 300 ppi JPEG a page. Score: true words found in order.
- paddleocr 3.7.0, paddlepaddle 3.3.1, paddlex 3.7.2, Python 3.13.11, macOS 26.6 on an Apple M5 Max CPU, at background priority.
-
Every run except the 2.x lines turned the page turn, unwarp and
line turn models off and set
cpu_threads=2. The 2.x lines ran as written on page 1, pluscpu_threads=2. The input rows read pages 1 to 3, to keep each run short. - The NotImplementedError: Docker Desktop on the Mac, python:3.13-slim for linux/amd64 under Rosetta, 2 CPUs, page 1.
- Offline: every proxy variable pointed at a closed port, page 1.
- Scripts and results are in research/bench/paddleocr-python-2026-11-22/.
What I did not test
- A GPU, a real x86 machine, an Intel Mac, and Windows.
- The answer's exact pins (paddleocr 3.3.3).
- The 2.x lines on the full PDF.
- return_word_box=True and other languages' models.
Sources
- PaddleOCR on GitHub
- paddleocr on PyPI
- We make the Apify Actor. PaddleOCR and PaddlePaddle are open source, and we do not make them.
Questions people ask
What does PaddleOCR predict() return?
A list with one result a page or image. Each result is a dict: rec_texts holds the text lines, rec_scores one score a line, and rec_boxes one box a line.
Why does my PaddleOCR loop return single letters?
In 3.x each result is a dict, so the 2.x line[1][0] takes the second letter of each key. Use the rec_texts list instead.
What replaced use_angle_cls in PaddleOCR 3?
use_textline_orientation. On paddleocr 3.7.0, use_angle_cls still works, with a DeprecationWarning.
How do I stop PaddleOCR from downloading models?
Keep its model folders in ~/.paddlex/official_models, or $PADDLE_PDX_CACHE_HOME/official_models. A folder that exists is used as is, even with no network.