File size: 12,142 Bytes
10469c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38238b6
10469c8
 
 
 
 
 
 
 
 
 
 
 
 
 
fcaba7f
 
10469c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38238b6
10469c8
 
 
 
 
 
 
 
 
 
 
3fbb725
10469c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38238b6
10469c8
 
 
 
 
 
 
 
 
 
 
3fbb725
10469c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5473ea7
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
---
license: apache-2.0
pipeline_tag: image-to-text
library_name: onnx
base_model: PaddlePaddle/PP-OCRv6_tiny_rec
language:
- en
- de
- fr
- es
- it
- pt
- nl
- pl
- sv
- da
- nb
- cs
- hu
- tr
- ro
tags:
- ocr
- text-recognition
- documents
- invoices
- receipts
- cpu
- onnx
- pp-ocrv6
---

# SumoOCR tiny

**A 1M-parameter, 1.8 MB OCR pipeline for business documents in Latin-script languages, running on one CPU core.**

![SumoOCR tiny: accuracy against speed on CPU](charts/accuracy_vs_speed.svg)

[Benchmark report](REPORT.md) · [SumoOCR](https://www.docsumo.com/blog/introducing-sumoocr) · [PP-OCRv6 tiny (base)](https://huggingface.co/PaddlePaddle/PP-OCRv6_tiny_rec) · [Citation](#citation)

```bash
pip install sumoocr
```

SumoOCR tiny is a text-line recognizer from Docsumo: Paddle's PP-OCRv6 tiny recognizer fine-tuned on public and business documents. Together with the PP-OCRv6 tiny text detector included in the package, it makes a complete OCR pipeline, and it is the first reader in SumoOCR, Docsumo's OCR engine.

| | SumoOCR tiny |
|---|---|
| **Size** | 1.04M parameters, 1.8 MB (0.43M detector + 0.61M recognizer) |
| **Speed** | 0.28 s a page (3.55 pages per second) on one CPU core (Mac mini M4), whole pipeline |
| **Accuracy** (word F1) | FUNSD 83.8 · SROIE 91.3 · XFUND 95.2 · OmniDocBench (English) 91.9 |
| **Languages** | English and European Latin-script languages (German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Hungarian, Turkish, Romanian, Nordic) |
| **Runtime** | ONNX Runtime (default) or OpenVINO, CPU only; no PyTorch or PaddlePaddle needed |
| **License** | Apache-2.0, the same as PP-OCRv6 |

Compared with the other engines tested, on the same pages and one CPU thread:

- **More accurate** than the same-size PP-OCRv6 tiny recognizer, PaddleOCR's own tiny setting, OCRia-nano-1 and Tesseract on all four benchmarks, and than Indra on SROIE, XFUND and OmniDocBench (FUNSD is a statistical tie).
- **Faster** than every engine tested: 1.65x faster than OCRia-nano-1, 1.72x than Indra 1.2.0, 3.3x than Tesseract and 8.7x than PaddleOCR's tiny setting.

Full numbers are in [Benchmarks](#benchmarks) and the [benchmark report](REPORT.md).

> SumoOCR tiny reads **text lines**. For whole pages it runs after a text detector (see [How it works](#how-it-works)); it does not produce layout blocks, tables or reading order.

Need checkbox and signature detection, more complex documents, or higher accuracy? Try [Docsumo](https://www.docsumo.com).

![SumoOCR tiny: word F1 by benchmark](charts/word_f1_by_benchmark.svg)

## Quickstart

```bash
pip install sumoocr              # models included (1.8 MB); `pip install "sumoocr[openvino]"` for OpenVINO
sumoocr invoice.png                # text, one line per line
sumoocr invoice.png --format json  # lines with boxes and confidences
```

### Python

```python
from sumoocr import SumoOCR

ocr = SumoOCR()                              # backend="openvino" for OpenVINO; threads=1 for one core
for line in ocr("invoice.png"):             # a path, a BGR numpy array (cv2.imread) or a PIL image
    print(line.text, round(line.conf, 3), line.box)

print(ocr.read_text("invoice.png"))          # the page as text, in reading order
text, conf = ocr.read_line("line.png")       # one text-line crop, no detection
```

### ONNX only

The two models are plain ONNX files in [`sumoocr/models/`](sumoocr/models): read a line crop without the package:

```python
import json

import cv2
import numpy as np
import onnxruntime as ort

sess = ort.InferenceSession("sumoocr/models/rec.onnx")
chars = json.load(open("sumoocr/models/rec.classes.json"))   # index 0 = CTC blank

def read_line(bgr):
    h, w = bgr.shape[:2]
    x = cv2.resize(bgr, (max(4, round(w * 40 / h)), 40)).astype(np.float32)
    x = ((x / 255.0 - 0.5) / 0.5).transpose(2, 0, 1)[None]   # 1 x 3 x 40 x W, BGR
    probs = sess.run(None, {"x": x})[0][0]                     # W/4 x 758
    ids = probs.argmax(1)
    keep = (ids != 0) & np.r_[True, ids[1:] != ids[:-1]]  # greedy CTC
    return "".join(chars[i] for i in ids[keep])

print(read_line(cv2.imread("line.png")))
```

### Input

- A page image (PNG, JPEG, TIFF, BMP, WebP; any size): the detector caps its long side at 1,280 px and automatically steps up to 2,400 px on dense small print such as newspapers (`adaptive=True`).
- Printed text in Latin script; pages turned by 90°, 180° or 270° are detected and turned back.
- Or one text-line crop (`read_line`).

### Output

| Field | What it is |
|---|---|
| `text` | the line's text |
| `conf` | mean character confidence, 0-1 (lines below 0.85 are dropped: `SumoOCR(text_score=...)`) |
| `box` | 4 [x, y] points, clockwise from the top-left, in pixels of the input image |

Lines come in reading order: top to bottom, left to right within a row.

## How it works

| Model | File | Role | Parameters |
|---|---|---|---|
| Text detector (PP-OCRv6 tiny, INT8 QDQ) | `sumoocr/models/det.onnx` | finds the text lines on the page | 0.43M |
| **SumoOCR tiny** (INT8 QDQ) | `sumoocr/models/rec.onnx` | reads each line: 40 px high, CTC over 758 characters (`rec.classes.json`) | 0.61M |
| **Total** |  |  | **1.04M** |

The page is scaled for the detector, its text boxes are cut out at full resolution and read one by one; a page whose lines read badly is tried upside down, and a page whose boxes stand on end is turned.

## Benchmarks

Word F1 (x 100) on whole pages, every engine on the same page images on CPU with one thread; bold = best in the column. Speed (pages/s) was measured on a Mac mini M4, 1 CPU core. Details, confidence intervals and the method: [benchmark report](REPORT.md).

| System (CPU) | FUNSD | SROIE | XFUND | OmniDocBench (EN) | Business Docs | pages/s | License |
|---|---|---|---|---|---|---|---|
| **SumoOCR tiny** | 83.8 | 91.3 | 95.2 | **91.9** | 98.9 | **3.55** | Apache-2.0 |
| SumoOCR \* | **85.6** | **94.5** | **96.0** | 90.9 | **99.0** | 0.91 | not released |
| Paddle tiny rec (our pipeline) | 79.0 | 89.3 | 94.5 | 90.4 | 97.5 | 1.31 | Apache-2.0 |
| PaddleOCR tiny ¹ | 77.0 | 86.5 | 94.5 | 91.0 | 97.1 | 0.41 | Apache-2.0 |
| OCRia-nano-1 | 80.9 | 87.0 | 92.7 | 82.2 | 98.0 | 2.15 | OCRia-nano-1 licence |
| Indra 1.2.0 | 83.4 | 89.2 | 93.6 | 90.0 | 98.2 | 2.07 | modified OpenRAIL-M |
| Tesseract 5 | 61.9 | 75.0 | 90.7 | 90.2 | 92.3 | 1.07 | Apache-2.0 |

FUNSD: 50 scanned forms. SROIE: 347 receipts. XFUND: 250 forms in German, Spanish, French, Italian and Portuguese. OmniDocBench: 755 English pages (papers, books, slides, magazines, newspapers). Business Docs: 41 public and synthetic business documents (invoices, statements, forms and US federal pages in 16 languages). "Paddle tiny rec (our pipeline)" is the PP-OCRv6 tiny recognizer SumoOCR tiny was fine-tuned from, run in the FP32 OpenVINO pipeline (see [Systems compared](REPORT.md#systems-compared)), not the shipped INT8 ONNX Runtime build with adaptive detection: its gap to SumoOCR tiny is the fine-tune plus those pipeline differences. The [line recognition table](#line-recognition-only) compares the two recognizers on the same crops. ¹ PaddleOCR 3.7 itself (Paddle's own package), its tiny setting: PP-OCRv6 tiny detector and recognizer. Timed natively, outside the container.

\* SumoOCR is Docsumo's full OCR engine (not released). It also supports checkboxes, signatures and more complex documents.

### Line recognition only

The same ground-truth line crops for every recognizer (no detector): character error rate ↓, case and spaces ignored.

| Recognizer | SROIE CER ↓ | XFUND CER ↓ | FUNSD CER ↓ |
|---|---|---|---|
| SumoOCR tiny | 2.93 % | **1.77 %** | **4.26 %** |
| PP-OCRv6 tiny rec | **2.62 %** | 1.96 % | 5.38 % |
| Tesseract 5 (`--psm 7`) | 8.58 % | 9.86 % | 12.92 % |

## Speed

**Hardware: Mac mini M4, 1 CPU core.** One process in a Docker container limited to 1 vCPU and 8 GB (`--cpus=1 --memory=8g`, Linux arm64), every engine on the same 100 pages (20 from each benchmark), taking turns page by page; whole pages, detection included.

| Configuration | mean word F1 (4 benchmarks) | pages/s | ms per page, 1 core (mean / P90) | License |
|---|---|---|---|---|
| **SumoOCR tiny** | 90.6 | 3.55 | 281 / 546 | Apache-2.0 |
| OCRia-nano-1 | 85.7 | 2.15 | 464 / 734 | OCRia-nano-1 licence |
| Indra 1.2.0 | 89.0 | 2.07 | 484 / 857 | modified OpenRAIL-M |
| Paddle tiny rec (our pipeline) | 88.3 | 1.31 | 764 / 1,456 | Apache-2.0 |
| Tesseract 5 | 79.4 | 1.07 | 931 / 2,074 | Apache-2.0 |
| SumoOCR | 91.7 | 0.91 | 1,103 / 1,976 | not released |
| PaddleOCR 3.7, tiny (PP-OCRv6 tiny det + rec) ¹ | 87.3 | 0.41 | 2,444 / 4,527 | Apache-2.0 |

¹ PaddleOCR was not run in the 1-vCPU container: it was timed natively on the same host, one thread (`cpu_threads=1`), 100 pages (8.7x the time of SumoOCR tiny run the same way on the same pages). Paddle's CPU kernels on ARM are much slower than its x86 path.

## Training

Fine-tuned from the PP-OCRv6 tiny recognizer (its output layer mapped to 758 Latin characters) on text-line crops (line heights 32-48 px) from business and public documents across diverse fonts and scan conditions, including:

- **Docsumo's internal benchmark documents** (their training split).
- **Public government documents**: US federal publications (IRS, Federal Register, GovInfo, Census Bureau, CFPB, GSA, Federal Reserve) and EU documents from EUR-Lex.
- **Synthetic rendered text lines**, with sentences from Tatoeba.

Only the model weights are released: no training document, crop or text is part of this repository. None of the four public benchmarks above (FUNSD, SROIE, XFUND, OmniDocBench) was used; 3 of the 41 Business Docs pages are public federal PDF pages that are also in the training set (see the [benchmark report](REPORT.md)).

Attribution. EUR-Lex documents: source EUR-Lex, © European Union, https://eur-lex.europa.eu. Synthetic sentences: Tatoeba (https://tatoeba.org), CC BY 2.0 FR.

## Limitations

- **Latin script only.** The 758 characters cover English and European Latin-script languages; Cyrillic, Greek, Arabic, Hebrew, Chinese, Japanese, Korean and Indic scripts are not recognized.
- **Printed text.** Handwriting was not a training target and was not measured here.
- **Lines, not documents.** It returns text lines with boxes and confidences: no layout blocks, tables, reading order or key-value structure (the benchmarks put every engine's lines in reading order with one shared routine).
- **Receipts and low-resolution scans are its weakest pages.** SROIE 91.3 and FUNSD 83.8 word F1, 3.1 and 1.8 points behind SumoOCR. On receipt line crops the base PP-OCRv6 tiny reads slightly better (2.62 % vs 2.93 % character errors).
- **Post-training INT8 quantization.** Both ONNX models use synthetic-calibrated INT8 QDQ quantization (keeping sensitive layers in FP32) for fast CPU inference at 1.8 MB total size; word F1 is within 0.2 points of FP32 on every benchmark (0.1 on the four-benchmark mean).

## Files

| File | What |
|---|---|
| `sumoocr/models/det.onnx` | text detector (PP-OCRv6 tiny, INT8 QDQ, opset-20 Gelu), 0.7 MB |
| `sumoocr/models/rec.onnx` | SumoOCR tiny recognizer (INT8 QDQ, opset-20 Gelu), 1.1 MB |
| `sumoocr/models/rec.classes.json` | the 758 output classes (0 = CTC blank, last = space) |
| `sumoocr/models/config.json` | input height and pre-processing of both models |
| `sumoocr/` | the Python package (`pip install sumoocr`) |
| `REPORT.md`, `charts/` | benchmark report |
| `LICENSE`, `NOTICE` | Apache-2.0; PaddleOCR attribution |

## License

Apache-2.0, the same licence as its base model, PP-OCRv6 tiny (PaddlePaddle); see `NOTICE`. The text detector is derived from the PP-OCRv6 tiny detector (Apache-2.0). ONNX Runtime (MIT) or OpenVINO (Apache-2.0) run the models.

## Citation

```bibtex
@misc{sumoocrtiny2026,
  title  = {SumoOCR tiny: a 0.6M-parameter text-line recognizer for business documents},
  author = {Docsumo},
  year   = {2026},
  url    = {https://huggingface.co/docsumo/sumoOCR-tiny}
}
```

---

Need checkbox and signature detection, more complex documents, or higher accuracy? Try [Docsumo](https://www.docsumo.com).