Models · Text recognition (OCR)
PP-OCRv5 (server / mobile)
PP-OCRv5 (Baidu, PaddleOCR 3, 2025): finds the text lines of a photo or document page in any orientation and reads them; Chinese (simplified and traditional), English, Japanese and pinyin; a server and a mobile version. Apache-2.0 code and weights.
experimental Fork of PaddlePaddle/PaddleOCR@dab3fe3 · backends: portable, kernels
- Paper PaddleOCR 3.0 Technical Report arXiv · first released 8 Jul 2025
- Paper Real-time Scene Text Detection with Differentiable Binarization AAAI 2020 · first released 20 Nov 2019
Paper 2025 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import ocr
model = ocr.load("ppocrv5-server") # kernels on a supported GPU, else portable PyTorch
result = model(image)
result.boxes # also: texts, scores
result.backend # what ran: mode, device, dtype, kernels fastforks bench ppocrv5-server Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.
Speed and memory
Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Kernels runs fp16. Portable runs fp16 on CUDA.
Input: synthetic, 1080x1920 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32 | fp32 | not measured | – | – | – | – |
| Original (own default)PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle']), no orientation / unwarping / text-line classifier; fp32 only: PaddleOCR's float16 needs TensorRT, and Paddle Inference float16 reads no text (detector overflow) | fp32 | 762 | – | 2,355 MiB/2,901 MiB | 2.1 | 2.03 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 277 | 2.8× | 1,357 MiB/1,452 MiB | 0.6 | 1.87 |
| Kernels | not measured | – | – | – | – | |
| Portable + torch.compile | 277 | 2.8× | 958 MiB/1,132 MiB | 105 (build) | – | |
| TensorRT fp16 | fp16 | 25.1 | 30× | 978 MiBenginenot comparable | 41 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-14. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.
Other devices
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-15 | Original | fp32 | cannot run here | – | 1080x1920 | |
| Portable | fp16 | 1607 | 6,545 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 2067 | 10,208 MiB process | matches | 1080x1920 | |
| Kernels | fp32 | not implemented | – | 1080x1920 | ||
CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
- The PP-OCRv5 technical report describes public and synthetic text data plus Baidu's own data; the exact sets are not listed.
Our reading of the licences, not legal advice.
Weights
PP-OCRv5_server_det/inference.json 402 KB· hosted on Hugging FacePP-OCRv5_server_det/inference.pdiparams 87.9 MB· hosted on Hugging FacePP-OCRv5_server_rec/inference.json 325 KB· hosted on Hugging FacePP-OCRv5_server_rec/inference.pdiparams 84.4 MB· hosted on Hugging FacePP-OCRv5_server_rec/config.json 352 KB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download ppocrv5-server).
Accuracy
The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.
IIIT5K test word crops
word accuracy / normalized edit similarity %
| Run | dtype | word_accuracy ↑ | ned ↑ | words | ms / word |
|---|---|---|---|---|---|
| Original fp32 | not measured | ||||
| Original fp16 | not measured | ||||
| Portable fp32 | fp32 | 94.80 | 98.26 | 3000 | – |
| Portable | not measured | ||||
| Kernels | not measured | ||||
The original code was not run on this dataset, so the table cannot show the distance to it.
The 3,000 official cropped test words, with no lexicon. Exact accuracy and normalized edit similarity compare lowercase ASCII letters and digits. Similarity is one minus edit distance divided by the longer word's length, averaged over the crops. For a model that also detects text, this benchmark runs only its recognition network on the supplied word crop. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks 3bf0bac7, 2026-11-18.
Closeness to the original
Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 and p99 <= 1.5 (absolute error of the output boxes).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.001 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.5 | 0 |
| GPU default dtypes, p99 |diff| | ≤ 1.5 | 0 |
Recorded for ppocrv5-server on RTX 5060 Ti, torch 2.10.0+cu130, 2026-11-17, with these kernels: cudnn_hacccutlass_convigevocr_levels
Details
PP-OCRv5 (PaddleOCR 3, Baidu 2025): a DB text detector (PP-HGNetV2 + LKPAN for server, PP-LCNetV3 + RSE-FPN for mobile) finds text lines of any orientation as quads; each line is cut out with a perspective warp and read by a CTC recogniser (PP-HGNetV2 / PP-LCNetV3 with an SVTR neck) over 18 383 characters (simplified and traditional Chinese, English, Japanese, pinyin). Inference as PaddleX's OCR pipeline without the document unwarping and the text-line orientation classifier. The portable `module()` is the detector with its normalisation.
- Input / output
- Input: one RGB image. Output: the text lines in reading order: a quad
[N, 4, 2]per line, its text and a confidence[N](text detector + recogniser; recognisers alone read the whole image as one line). - Input size
- any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (7,268 MiB allocated)
- Options
box_threshold=0.60.0 to 1.0· changes the outputunclip_ratio=1.5>= 0.1· changes the output
- Outputs
boxes,texts,scores- Checkpoint
server=true- CUDA kernels
ocr_levelsigevIGEV stereo: convolution epilogues, correlation lookups, GRU gatescutlass_convCUTLASS convolutions with the recurrent update (GRU) fused incudnn_haccconvolutions with fp16 accumulation (cuDNN)
- Apple (MPS)
- fp32, fp16
Limitations
- No document orientation / unwarping and no text-line orientation classifier (upside-down lines are read as they are).
- The DB post-processing runs on the CPU (OpenCV-exact geometry); hole contours of the binary map are not boxed (upstream boxes them too; they rarely pass `box_threshold`).
Full reference, generated from the repository
PP-OCRv5 (Baidu, PaddleOCR 3, 2025): finds the text lines of a photo or document page in any orientation and reads them; Chinese (simplified and traditional), English, Japanese and pinyin; a server and a mobile version. Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
ppocrv5-server | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 762 277 – 277 25.1 | 2355 / 2901 1357 / 1452 – 958 / 1132 1131 / 1146 |
ppocrv5-mobile | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 619 418 153 – 115 2.68 | 476 / 1094 393 / 1005 289 / 448 – 292 / 448 241 / 268 |
Details
- Original code: https://github.com/PaddlePaddle/PaddleOCR at
dab3fe353790 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/PaddlePaddle/PaddleOCR/blob/dab3fe35379033fdcb2d0e9572fac0b36c9a9ebf/LICENSE ; https://huggingface.co/PaddlePaddle/PP-OCRv5_server_det
- Training data: The PP-OCRv5 technical report describes public and synthetic text data plus Baidu's own data; the exact sets are not listed.
- Options:
box_threshold= 0.6 (0.0 to 1.0; alsotext_det_box_thresh),unclip_ratio= 1.5 (>= 0.1; alsotext_det_unclip_ratio) - Kernel libraries:
ocr_levels,igev,cutlass_conv,cudnn_hacc - Variants:
ppocrv5-server,ppocrv5-mobile - Outputs: boxes, texts, scores
- Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
ppocrv5-server3000x4000 (7.1 GiB peak allocated, 9.8 reserved);ppocrv5-mobile3000x4000 (1.4 GiB peak allocated, 2.3 reserved) ppocrv5-server1080x1920, first call: portable + torch.compile 105 s (cold Inductor cache), TensorRT fp16 41 s (ONNX + engine).ppocrv5-mobile1080x1920, first call: portable + torch.compile 75 s (cold Inductor cache), TensorRT fp16 156 s (ONNX + engine).ppocrv5-serveroriginal 1080x1920: PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle']), no orientation / unwarping / text-line classifier; fp32 only: PaddleOCR's float16 needs TensorRT, and Paddle Inference float16 reads no text (detector overflow)ppocrv5-mobileoriginal (fp32) 1080x1920: PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle']), no orientation / unwarping / text-line classifierppocrv5-mobileoriginal 1080x1920: PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle_fp16']), no orientation / unwarping / text-line classifierppocrv5-serverload / first call: original 2.07 s / 2.032 s, portable 0.56 s / 1.874 sppocrv5-mobileload / first call: original 1.51 s / 1.82 s, portable 0.27 s / 2.819 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
The 3,000 official cropped test words, with no lexicon. Exact accuracy and normalized edit similarity compare lowercase ASCII letters and digits. Similarity is one minus edit distance divided by the longer word's length, averaged over the crops. For a model that also detects text, this benchmark runs only its recognition network on the supplied word crop. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | portable fp32 | note |
|---|---|---|---|
ppocrv5-server | IIIT5K test word crops, word accuracy / normalized edit similarity % | 94.80 / 98.26 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 3bf0bac7, 2026-11-18.
Parity
CPU, float32: max |diff| <= 0.001 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.5 and p99 <= 1.5 (absolute error of the output boxes).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
ppocrv5-server | 0.0 / 0.0 | RTX 5060 Ti, torch 2.10.0+cu130 | cudnn_hacc@cudnn91501, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120, ocr_levels@3187ecc54497:sm_120 |
ppocrv5-mobile | 0.0625 / 1.0 | RTX 5060 Ti, torch 2.10.0+cu130 | cudnn_hacc@cudnn91501, cutlass_conv@988138e042cb:sm_120, igev@f075827d68c6:sm_120, ocr_levels@3187ecc54497:sm_120 |
Limitations
- No document orientation / unwarping and no text-line orientation classifier (upside-down lines are read as they are).
- The DB post-processing runs on the CPU (OpenCV-exact geometry); hole contours of the binary map are not boxed (upstream boxes them too; they rarely pass
box_threshold).
Example output
No example rendered for this checkpoint yet.