Models · Text recognition (OCR)
PP-OCRv6 (tiny / small / medium)
PP-OCRv6 (Baidu, PaddleOCR 3.7, 2026): finds the text lines of a photo or document page and reads them, like PP-OCRv5 with newer, re-parameterised networks; Chinese (simplified and traditional), English, Japanese and more; a tiny, a small and a medium version. Apache-2.0 code and weights.
experimental Fork of PaddlePaddle/PaddleOCR@dab3fe3 · backends: portable, kernels
- Paper PP-OCRv6: From 1.5M to 34.5M Parameters, Surpassing Billion-Scale VLMs on OCR Tasks arXiv · first released 11 Jun 2026
- Paper Real-time Scene Text Detection with Differentiable Binarization AAAI 2020 · first released 20 Nov 2019
Paper 2026 Added in 0.4.0 Evaluated with 0.4.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("ppocrv6-tiny") # fastest backend that runs here
result = model("photo.jpg")
# result fields: texts, boxes, scores
texts = result.texts # list of strings
arrays = result.numpy() # the tensor fields as NumPy arrays: arrays["boxes"]
result.backend # what ran: mode, device, dtype
Other ways to run it
- Backend:
ocr.load("ppocrv6-tiny", mode="kernels") # or "portable", "auto" (default) - Precision:
ocr.load("ppocrv6-tiny", dtype="float32") # full precision: slower, portable only - Options:
ocr.load("ppocrv6-tiny", options={"box_threshold": 0.6, "unclip_ratio": 1.5})
fastforks bench ppocrv6-tiny 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 fp32PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle']), no orientation / unwarping / text-line classifier; paddlex 3.3 has no PP-OCRv6 class: the v5 class of the same size tier (mobile for tiny/small, server for medium) runs the v6 export dirs | fp32 | 210 | 0.97× | 231 MiB/398 MiB | 0.9 | 1.19 |
| Original fp16PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle_fp16']), no orientation / unwarping / text-line classifier; paddlex 3.3 has no PP-OCRv6 class: the v5 class of the same size tier (mobile for tiny/small, server for medium) runs the v6 export dirs | fp16 | 203 | – | 196 MiB/355 MiB | 1.0 | 1.13 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 47.9 | 4.2× | 703 MiB/718 MiB | 0.1 | 2.50 |
| Kernels | fp16 | 47.9 | 4.2× | 703 MiB/718 MiB | 0.1 | 2.50 |
| Portable + torch.compile | 55.0 | 3.7× | 703 MiB/718 MiB | 50 (build) | – | |
| TensorRT fp16 | fp16 | 2.00 | 102× | 154 MiBenginenot comparable | 46 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28. 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
Not measured on other devices yet.
Licence and weights
Commercial use allowed
- Code
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
- PaddleOCR does not list the exact training sets of PP-OCRv6 (public and synthetic text data plus Baidu's own data).
Our reading of the licences, not legal advice.
Weights
PP-OCRv6_tiny_det/inference.json 229 KB· hosted on Hugging FacePP-OCRv6_tiny_det/inference.pdiparams 1.7 MB· hosted on Hugging FacePP-OCRv6_tiny_rec/inference.json 109 KB· hosted on Hugging FacePP-OCRv6_tiny_rec/inference.pdiparams 4.4 MB· hosted on Hugging FacePP-OCRv6_tiny_rec/inference.yml 55.6 KB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download ppocrv6-tiny).
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 | 89.20 | 96.83 | 3000 | 2.76 |
| Portable | fp16 | 89.33 | 96.90 | 3000 | 3.15 |
| Kernels | fp16 | 89.33 | 96.90 | 3000 | 3.13 |
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 c0606f892, 2026-11-30.
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.02083 |
| GPU default dtypes, p99 |diff| | ≤ 1.5 | 1 |
Recorded for ppocrv6-tiny on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-28, with these kernels: ocr_levels
Details
PP-OCRv6 (PaddleOCR 3.7, Baidu 2026): a DB text detector (PP-LCNetV4 backbone with a RepLK-FPN neck for tiny and small, a RepLK-PAN neck with IntraCL for medium) finds text lines of any orientation as quads; each line is cut out with a perspective warp and read by a CTC recogniser (PP-LCNetV4; small and medium with an SVTR attention neck) over 6 906 (tiny) or 18 710 (small, medium) characters. Inference as PaddleX's OCR pipeline without the document unwarping and the text-line orientation classifier. The Paddle graphs are exported re-parameterised, so the networks run as the exported operator list (`net.Program`). 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 (3,892 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- CUDA kernels
ocr_levels
- 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`).
- The detector and recogniser run as the exported Paddle operator list (no per-layer PyTorch modules); the MLX port interprets the same list (compiled per input shape).
Full reference, generated from the repository
PP-OCRv6 (Baidu, PaddleOCR 3.7, 2026): finds the text lines of a photo or document page and reads them, like PP-OCRv5 with newer, re-parameterised networks; Chinese (simplified and traditional), English, Japanese and more; a tiny, a small and a medium version. Apache-2.0 code and weights.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
ppocrv6-tiny | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 203 47.9 47.9 55.0 2.00 | 196 / 355 703 / 718 703 / 718 703 / 718 228 / 298 |
ppocrv6-small | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 386 88.0 88.0 143 4.49 | 415 / 1024 1377 / 1394 1377 / 1394 1377 / 1394 224 / 270 |
ppocrv6-medium | synthetic (1080x1920) | original portable kernels portable + torch.compile TensorRT fp16 | 490 224 224 230 17.4 | 516 / 950 2876 / 2884 2876 / 2884 2876 / 2904 505 / 526 |
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-OCRv6_medium_det
- Training data: PaddleOCR does not list the exact training sets of PP-OCRv6 (public and synthetic text data plus Baidu's own data).
- 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 - Variants:
ppocrv6-tiny,ppocrv6-small,ppocrv6-medium - 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):
ppocrv6-tiny3000x4000 (3.8 GiB peak allocated, 4.4 reserved);ppocrv6-small3000x4000 (6.0 GiB peak allocated, 6.0 reserved);ppocrv6-medium1988x2880 (7.5 GiB peak allocated, 7.6 reserved) ppocrv6-tiny1080x1920, first call: portable + torch.compile 50 s (cold Inductor cache), TensorRT fp16 46 s (ONNX + engine).ppocrv6-small1080x1920, first call: portable + torch.compile 47 s (cold Inductor cache), TensorRT fp16 54 s (ONNX + engine).ppocrv6-medium1080x1920, first call: portable + torch.compile 42 s (cold Inductor cache), TensorRT fp16 66 s (ONNX + engine).ppocrv6-tinyoriginal 1080x1920: PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle_fp16']), no orientation / unwarping / text-line classifier; paddlex 3.3 has no PP-OCRv6 class: the v5 class of the same size tier (mobile for tiny/small, server for medium) runs the v6 export dirsppocrv6-smalloriginal 1080x1920: PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle_fp16']), no orientation / unwarping / text-line classifier; paddlex 3.3 has no PP-OCRv6 class: the v5 class of the same size tier (mobile for tiny/small, server for medium) runs the v6 export dirsppocrv6-mediumoriginal 1080x1920: PaddleOCR 3 3.3.3 / paddle 3.3.1 OCR pipeline (GPU Paddle Inference, run mode ['paddle_fp16']), no orientation / unwarping / text-line classifier; paddlex 3.3 has no PP-OCRv6 class: the v5 class of the same size tier (mobile for tiny/small, server for medium) runs the v6 export dirsppocrv6-tinyload / first call: original 0.93 s / 1.192 s, portable 0.15 s / 2.505 s, kernels 0.15 s / 2.503 sppocrv6-smallload / first call: original 0.87 s / 1.163 s, portable 0.15 s / 2.24 s, kernels 0.15 s / 2.237 sppocrv6-mediumload / first call: original 1.16 s / 1.093 s, portable 0.26 s / 2.325 s, kernels 0.26 s / 2.318 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 | portable fp32 | kernels | note |
|---|---|---|---|---|---|
ppocrv6-tiny | IIIT5K test word crops, word accuracy / normalized edit similarity % | 89.33 / 96.90 | 89.20 / 96.83 | 89.33 / 96.90 | |
ppocrv6-small | IIIT5K test word crops, word accuracy / normalized edit similarity % | 96.40 / 99.13 | 96.37 / 99.13 | 96.40 / 99.13 | |
ppocrv6-medium | IIIT5K test word crops, word accuracy / normalized edit similarity % | 97.13 / 99.27 | 97.13 / 99.27 | 97.13 / 99.27 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks c0606f892, 2026-11-30.
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 |
|---|---|---|---|
ppocrv6-tiny | 0.02083 / 1.0 | RTX 5060 Ti, torch 2.14.1+cu130 | ocr_levels@3187ecc54497:sm_120 |
ppocrv6-small | 0.0 / 0.0 | RTX 5060 Ti, torch 2.14.1+cu130 | ocr_levels@3187ecc54497:sm_120 |
ppocrv6-medium | 0.0 / 0.0 | RTX 5060 Ti, torch 2.14.1+cu130 | 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). - The detector and recogniser run as the exported Paddle operator list (no per-layer PyTorch modules); the MLX port interprets the same list (compiled per input shape).
Example output
No example rendered for this checkpoint yet.