echo840 commited on
Commit
7eba48a
·
verified ·
1 Parent(s): f8312b0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +708 -3
README.md CHANGED
@@ -1,3 +1,708 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: image-text-to-text
3
+ library_name: monkeyocr
4
+ language:
5
+ - zh
6
+ - en
7
+ tags:
8
+ - OCR
9
+ ---
10
+ <div align="center" xmlns="http://www.w3.org/1999/html">
11
+ <h1 align="center">
12
+ MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm
13
+ </h1>
14
+
15
+ [![arXiv](https://img.shields.io/badge/Arxiv-MonkeyOCR-b31b1b.svg?logo=arXiv)](https://arxiv.org/abs/2506.05218)
16
+ [![HuggingFace](https://img.shields.io/badge/HuggingFace%20Weights-black.svg?logo=HuggingFace)](https://huggingface.co/echo840/MonkeyOCR)
17
+ [![GitHub issues](https://img.shields.io/github/issues/Yuliang-Liu/MonkeyOCR?color=critical&label=Issues)](https://github.com/Yuliang-Liu/MonkeyOCR/issues?q=is%3Aopen+is%3Aissue)
18
+ [![GitHub closed issues](https://img.shields.io/github/issues-closed/Yuliang-Liu/MonkeyOCR?color=success&label=Issues)](https://github.com/Yuliang-Liu/MonkeyOCR/issues?q=is%3Aissue+is%3Aclosed)
19
+ [![GitHub views](https://komarev.com/ghpvc/?username=Yuliang-Liu&repo=MonkeyOCR&color=brightgreen&label=Views)](https://github.com/Yuliang-Liu/MonkeyOCR)
20
+ </div>
21
+
22
+
23
+ > **MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm**<br>
24
+ > Zhang Li, Yuliang Liu, Qiang Liu, Zhiyin Ma, Ziyang Zhang, Shuo Zhang, Zidun Guo, Jiarui Zhang, Xinyu Wang, Xiang Bai <br>
25
+ [![arXiv](https://img.shields.io/badge/Arxiv-b31b1b.svg?logo=arXiv)](https://arxiv.org/abs/2506.05218)
26
+ [![Source_code](https://img.shields.io/badge/Code-Available-white)](https://github.com/Yuliang-Liu/MonkeyOCR)
27
+ [![Model Weight](https://img.shields.io/badge/HuggingFace-gray)](https://huggingface.co/echo840/MonkeyOCR)
28
+ [![Model Weight](https://img.shields.io/badge/ModelScope-green)](https://modelscope.cn/models/l1731396519/MonkeyOCR)
29
+ [![Demo](https://img.shields.io/badge/Demo-blue)](http://vlrlabmonkey.xyz:7685/)
30
+
31
+
32
+
33
+ ## Introduction
34
+ MonkeyOCR adopts a Structure-Recognition-Relation (SRR) triplet paradigm, which simplifies the multi-tool pipeline of modular approaches while avoiding the inefficiency of using large multimodal models for full-page document processing.
35
+
36
+ 1. Compared with the pipeline-based method MinerU, our approach achieves an average improvement of 5.1% across nine types of Chinese and English documents, including a 15.0% gain on formulas and an 8.6% gain on tables.
37
+ 2. Compared to end-to-end models, our 3B-parameter model achieves the best average performance on English documents, outperforming models such as Gemini 2.5 Pro and Qwen2.5 VL-72B.
38
+ 3. For multi-page document parsing, our method reaches a processing speed of 0.84 pages per second, surpassing MinerU (0.65) and Qwen2.5 VL-7B (0.12).
39
+
40
+ <img src="https://v1.ax1x.com/2025/06/05/7jQ3cm.png" alt="7jQ3cm.png" border="0" />
41
+
42
+ MonkeyOCR currently does not support photographed documents, but we will continue to improve it in future updates. Stay tuned!
43
+ Currently, our model is deployed on a single GPU, so if too many users upload files at the same time, issues like “This application is currently busy” may occur. We're actively working on supporting Ollama and other deployment solutions to ensure a smoother experience for more users. Additionally, please note that the processing time shown on the demo page does not reflect computation time alone—it also includes result uploading and other overhead. During periods of high traffic, this time may be longer. The inference speeds of MonkeyOCR, MinerU, and Qwen2.5 VL-7B were measured on an H800 GPU.
44
+
45
+ 🚀🚀🚀 Chinese Video Tutorial (Thanks to [leo009](https://huggingface.co/leo009) for sharing!)
46
+
47
+ https://youtu.be/T9oaqp-IaZ0
48
+
49
+ https://www.bilibili.com/video/BV1sxKhztEx1/
50
+
51
+
52
+ ## News
53
+ * ```2025.06.05 ``` 🚀 We release MonkeyOCR, which supports the parsing of various types of Chinese and English documents.
54
+
55
+
56
+ ## Quick Start
57
+
58
+ ### 1. Install MonkeyOCR
59
+ ```bash
60
+ conda create -n MonkeyOCR python=3.10
61
+ conda activate MonkeyOCR
62
+
63
+ git clone https://github.com/Yuliang-Liu/MonkeyOCR.git
64
+ cd MonkeyOCR
65
+
66
+ # Install pytorch, see https://pytorch.org/get-started/previous-versions/ for your cuda version
67
+ pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124
68
+ pip install -e .
69
+ ```
70
+ ### 2. Download Model Weights
71
+ Download our model from Huggingface.
72
+ ```python
73
+ pip install huggingface_hub
74
+
75
+ python tools/download_model.py
76
+ ```
77
+ You can also download our model from ModelScope.
78
+
79
+ ```python
80
+ pip install modelscope
81
+
82
+ python tools/download_model.py -t modelscope
83
+ ```
84
+ ### 3. Inference
85
+ ```bash
86
+ # Make sure in MonkeyOCR directory
87
+ python parse.py path/to/your.pdf
88
+ # or with image as input
89
+ pyhton parse.py path/to/your/image
90
+ # Specify output path and model configs path
91
+ python parse.py path/to/your.pdf -o ./output -c config.yaml
92
+ ```
93
+
94
+ #### Output Results
95
+ MonkeyOCR generates three types of output files:
96
+
97
+ 1. **Processed Markdown File** (`your.md`): The final parsed document content in markdown format, containing text, formulas, tables, and other structured elements.
98
+ 2. **Layout Results** (`your_layout.pdf`): The layout results drawed on origin PDF.
99
+ 2. **Intermediate Block Results** (`your_middle.json`): A JSON file containing detailed information about all detected blocks, including:
100
+ - Block coordinates and positions
101
+ - Block content and type information
102
+ - Relationship information between blocks
103
+
104
+ These files provide both the final formatted output and detailed intermediate results for further analysis or processing.
105
+
106
+ ### 4. Gradio Demo
107
+ ```bash
108
+ # Prepare your env for gradio
109
+ pip install gradio==5.23.3
110
+ pip install pdf2image==1.17.0
111
+ ```
112
+ ```bash
113
+ # Start demo
114
+ python demo/demo_gradio.py
115
+ ```
116
+ ### Fix **shared memory error** on **RTX 3090 / 4090 / ...** GPUs (Optional)
117
+
118
+ Our 3B model runs efficiently on NVIDIA RTX 3090. However, when using **LMDeploy** as the inference backend, you may encounter compatibility issues on **RTX 3090 / 4090** GPUs — particularly the following error:
119
+
120
+ ```
121
+ triton.runtime.errors.OutOfResources: out of resource: shared memory
122
+ ```
123
+
124
+ To work around this issue, you can apply the patch below:
125
+
126
+ ```bash
127
+ python tools/lmdeploy_patcher.py patch
128
+ ```
129
+
130
+ > ⚠️ **Note:** This command will modify LMDeploy's source code in your environment.
131
+ > To revert the changes, simply run:
132
+
133
+ ```bash
134
+ python tools/lmdeploy_patcher.py restore
135
+ ```
136
+
137
+ **Special thanks to [@pineking](https://github.com/pineking) for the solution!**
138
+
139
+ ### Switch inference backend (Optional)
140
+
141
+ You can switch inference backend to `transformers` following the steps below:
142
+
143
+ 1. Install required dependency (if not already installed):
144
+ ```bash
145
+ # install flash attention 2, you can download the corresponding version from https://github.com/Dao-AILab/flash-attention/releases/
146
+ pip install flash-attn==2.7.4.post1 --no-build-isolation
147
+ ```
148
+ 2. Open the `model_configs.yaml` file
149
+ 3. Set `chat_config.backend` to `transformers`
150
+ 4. Adjust the `batch_size` according to your GPU's memory capacity to ensure stable performance
151
+
152
+ Example configuration:
153
+
154
+ ```yaml
155
+ chat_config:
156
+ backend: transformers
157
+ batch_size: 10 # Adjust based on your available GPU memory
158
+ ```
159
+
160
+
161
+ ## Benchmark Results
162
+
163
+
164
+ Here are the evaluation results of our model on OmniDocBench. MonkeyOCR-3B uses DocLayoutYOLO as the structure detection model, while MonkeyOCR-3B* uses our trained structure detection model with improved Chinese performance.
165
+
166
+
167
+ ### 1. The end-to-end evaluation results of different tasks.
168
+
169
+ <table style="width:100%; border-collapse:collapse; text-align:center;" border="0">
170
+ <thead>
171
+ <tr>
172
+ <th rowspan="2">Model Type</th>
173
+ <th rowspan="2">Methods</th>
174
+ <th colspan="2">Overall Edit↓</th>
175
+ <th colspan="2">Text Edit↓</th>
176
+ <th colspan="2">Formula Edit↓</th>
177
+ <th colspan="2">Formula CDM↑</th>
178
+ <th colspan="2">Table TEDS↑</th>
179
+ <th colspan="2">Table Edit↓</th>
180
+ <th colspan="2">Read Order Edit↓</th>
181
+ </tr>
182
+ <tr>
183
+ <th>EN</th>
184
+ <th>ZH</th>
185
+ <th>EN</th>
186
+ <th>ZH</th>
187
+ <th>EN</th>
188
+ <th>ZH</th>
189
+ <th>EN</th>
190
+ <th>ZH</th>
191
+ <th>EN</th>
192
+ <th>ZH</th>
193
+ <th>EN</th>
194
+ <th>ZH</th>
195
+ <th>EN</th>
196
+ <th>ZH</th>
197
+ </tr>
198
+ </thead>
199
+ <tbody>
200
+ <tr>
201
+ <td rowspan="7">Pipeline Tools</td>
202
+ <td>MinerU</td>
203
+ <td>0.150</td>
204
+ <td>0.357</td>
205
+ <td>0.061</td>
206
+ <td>0.215</td>
207
+ <td>0.278</td>
208
+ <td>0.577</td>
209
+ <td>57.3</td>
210
+ <td>42.9</td>
211
+ <td>78.6</td>
212
+ <td>62.1</td>
213
+ <td>0.180</td>
214
+ <td>0.344</td>
215
+ <td><strong>0.079</strong></td>
216
+ <td>0.292</td>
217
+ </tr>
218
+ <tr>
219
+ <td>Marker</td>
220
+ <td>0.336</td>
221
+ <td>0.556</td>
222
+ <td>0.080</td>
223
+ <td>0.315</td>
224
+ <td>0.530</td>
225
+ <td>0.883</td>
226
+ <td>17.6</td>
227
+ <td>11.7</td>
228
+ <td>67.6</td>
229
+ <td>49.2</td>
230
+ <td>0.619</td>
231
+ <td>0.685</td>
232
+ <td>0.114</td>
233
+ <td>0.340</td>
234
+ </tr>
235
+ <tr>
236
+ <td>Mathpix</td>
237
+ <td>0.191</td>
238
+ <td>0.365</td>
239
+ <td>0.105</td>
240
+ <td>0.384</td>
241
+ <td>0.306</td>
242
+ <td><strong>0.454</strong></td>
243
+ <td>62.7</td>
244
+ <td><strong>62.1</strong></td>
245
+ <td>77.0</td>
246
+ <td>67.1</td>
247
+ <td>0.243</td>
248
+ <td>0.320</td>
249
+ <td>0.108</td>
250
+ <td>0.304</td>
251
+ </tr>
252
+ <tr>
253
+ <td>Docling</td>
254
+ <td>0.589</td>
255
+ <td>0.909</td>
256
+ <td>0.416</td>
257
+ <td>0.987</td>
258
+ <td>0.999</td>
259
+ <td>1</td>
260
+ <td>-</td>
261
+ <td>-</td>
262
+ <td>61.3</td>
263
+ <td>25.0</td>
264
+ <td>0.627</td>
265
+ <td>0.810</td>
266
+ <td>0.313</td>
267
+ <td>0.837</td>
268
+ </tr>
269
+ <tr>
270
+ <td>Pix2Text</td>
271
+ <td>0.320</td>
272
+ <td>0.528</td>
273
+ <td>0.138</td>
274
+ <td>0.356</td>
275
+ <td>0.276</td>
276
+ <td>0.611</td>
277
+ <td>78.4</td>
278
+ <td>39.6</td>
279
+ <td>73.6</td>
280
+ <td>66.2</td>
281
+ <td>0.584</td>
282
+ <td>0.645</td>
283
+ <td>0.281</td>
284
+ <td>0.499</td>
285
+ </tr>
286
+ <tr>
287
+ <td>Unstructured</td>
288
+ <td>0.586</td>
289
+ <td>0.716</td>
290
+ <td>0.198</td>
291
+ <td>0.481</td>
292
+ <td>0.999</td>
293
+ <td>1</td>
294
+ <td>-</td>
295
+ <td>-</td>
296
+ <td>0</td>
297
+ <td>0.06</td>
298
+ <td>1</td>
299
+ <td>0.998</td>
300
+ <td>0.145</td>
301
+ <td>0.387</td>
302
+ </tr>
303
+ <tr>
304
+ <td>OpenParse</td>
305
+ <td>0.646</td>
306
+ <td>0.814</td>
307
+ <td>0.681</td>
308
+ <td>0.974</td>
309
+ <td>0.996</td>
310
+ <td>1</td>
311
+ <td>0.11</td>
312
+ <td>0</td>
313
+ <td>64.8</td>
314
+ <td>27.5</td>
315
+ <td>0.284</td>
316
+ <td>0.639</td>
317
+ <td>0.595</td>
318
+ <td>0.641</td>
319
+ </tr>
320
+ <tr>
321
+ <td rowspan="5">Expert VLMs</td>
322
+ <td>GOT-OCR</td>
323
+ <td>0.287</td>
324
+ <td>0.411</td>
325
+ <td>0.189</td>
326
+ <td>0.315</td>
327
+ <td>0.360</td>
328
+ <td>0.528</td>
329
+ <td>74.3</td>
330
+ <td>45.3</td>
331
+ <td>53.2</td>
332
+ <td>47.2</td>
333
+ <td>0.459</td>
334
+ <td>0.520</td>
335
+ <td>0.141</td>
336
+ <td>0.280</td>
337
+ </tr>
338
+ <tr>
339
+ <td>Nougat</td>
340
+ <td>0.452</td>
341
+ <td>0.973</td>
342
+ <td>0.365</td>
343
+ <td>0.998</td>
344
+ <td>0.488</td>
345
+ <td>0.941</td>
346
+ <td>15.1</td>
347
+ <td>16.8</td>
348
+ <td>39.9</td>
349
+ <td>0</td>
350
+ <td>0.572</td>
351
+ <td>1.000</td>
352
+ <td>0.382</td>
353
+ <td>0.954</td>
354
+ </tr>
355
+ <tr>
356
+ <td>Mistral OCR</td>
357
+ <td>0.268</td>
358
+ <td>0.439</td>
359
+ <td>0.072</td>
360
+ <td>0.325</td>
361
+ <td>0.318</td>
362
+ <td>0.495</td>
363
+ <td>64.6</td>
364
+ <td>45.9</td>
365
+ <td>75.8</td>
366
+ <td>63.6</td>
367
+ <td>0.600</td>
368
+ <td>0.650</td>
369
+ <td>0.083</td>
370
+ <td>0.284</td>
371
+ </tr>
372
+ <tr>
373
+ <td>OLMOCR-sglang</td>
374
+ <td>0.326</td>
375
+ <td>0.469</td>
376
+ <td>0.097</td>
377
+ <td>0.293</td>
378
+ <td>0.455</td>
379
+ <td>0.655</td>
380
+ <td>74.3</td>
381
+ <td>43.2</td>
382
+ <td>68.1</td>
383
+ <td>61.3</td>
384
+ <td>0.608</td>
385
+ <td>0.652</td>
386
+ <td>0.145</td>
387
+ <td>0.277</td>
388
+ </tr>
389
+ <tr>
390
+ <td>SmolDocling-256M</td>
391
+ <td>0.493</td>
392
+ <td>0.816</td>
393
+ <td>0.262</td>
394
+ <td>0.838</td>
395
+ <td>0.753</td>
396
+ <td>0.997</td>
397
+ <td>32.1</td>
398
+ <td>0.55</td>
399
+ <td>44.9</td>
400
+ <td>16.5</td>
401
+ <td>0.729</td>
402
+ <td>0.907</td>
403
+ <td>0.227</td>
404
+ <td>0.522</td>
405
+ </tr>
406
+ <tr>
407
+ <td rowspan="3">General VLMs</td>
408
+ <td>GPT4o</td>
409
+ <td>0.233</td>
410
+ <td>0.399</td>
411
+ <td>0.144</td>
412
+ <td>0.409</td>
413
+ <td>0.425</td>
414
+ <td>0.606</td>
415
+ <td>72.8</td>
416
+ <td>42.8</td>
417
+ <td>72.0</td>
418
+ <td>62.9</td>
419
+ <td>0.234</td>
420
+ <td>0.329</td>
421
+ <td>0.128</td>
422
+ <td>0.251</td>
423
+ </tr>
424
+ <tr>
425
+ <td>Qwen2.5-VL-7B</td>
426
+ <td>0.312</td>
427
+ <td>0.406</td>
428
+ <td>0.157</td>
429
+ <td>0.228</td>
430
+ <td>0.351</td>
431
+ <td>0.574</td>
432
+ <td><strong>79.0</strong></td>
433
+ <td>50.2</td>
434
+ <td>76.4</td>
435
+ <td>72.2</td>
436
+ <td>0.588</td>
437
+ <td>0.619</td>
438
+ <td>0.149</td>
439
+ <td>0.203</td>
440
+ </tr>
441
+ <tr>
442
+ <td>InternVL3-8B</td>
443
+ <td>0.314</td>
444
+ <td>0.383</td>
445
+ <td>0.134</td>
446
+ <td>0.218</td>
447
+ <td>0.417</td>
448
+ <td>0.563</td>
449
+ <td>78.3</td>
450
+ <td>49.3</td>
451
+ <td>66.1</td>
452
+ <td>73.1</td>
453
+ <td>0.586</td>
454
+ <td>0.564</td>
455
+ <td>0.118</td>
456
+ <td>0.186</td>
457
+ </tr>
458
+ <tr>
459
+ <td rowspan="2">Mix</td>
460
+ <td>MonkeyOCR-3B <a href="https://huggingface.co/echo840/MonkeyOCR/blob/main/Structure/doclayout_yolo_docstructbench_imgsz1280_2501.pt">[Weight]</a></td>
461
+ <td><strong>0.140</strong></td>
462
+ <td>0.297</td>
463
+ <td><strong>0.058</strong></td>
464
+ <td>0.185</td>
465
+ <td><strong>0.238</strong></td>
466
+ <td>0.506</td>
467
+ <td>78.7</td>
468
+ <td>51.4</td>
469
+ <td><strong>80.2</strong></td>
470
+ <td><strong>77.7</strong></td>
471
+ <td><strong>0.170</strong></td>
472
+ <td><strong>0.253</strong></td>
473
+ <td>0.093</td>
474
+ <td>0.244</td>
475
+ </tr>
476
+ <tr>
477
+ <td>MonkeyOCR-3B* <a href="https://huggingface.co/echo840/MonkeyOCR/blob/main/Structure/layout_zh.pt">[Weight]</a></td>
478
+ <td>0.154</td>
479
+ <td><strong>0.277</strong></td>
480
+ <td>0.073</td>
481
+ <td><strong>0.134</strong></td>
482
+ <td>0.255</td>
483
+ <td>0.529</td>
484
+ <td>78.5</td>
485
+ <td>50.8</td>
486
+ <td>78.2</td>
487
+ <td>76.2</td>
488
+ <td>0.182</td>
489
+ <td>0.262</td>
490
+ <td>0.105</td>
491
+ <td><strong>0.183</strong></td>
492
+ </tr>
493
+ </tbody>
494
+ </table>
495
+
496
+
497
+
498
+
499
+ ### 2. The end-to-end text recognition performance across 9 PDF page types.
500
+ <table style="width: 100%; border-collapse: collapse; text-align: center;">
501
+ <thead>
502
+ <tr style="border-bottom: 2px solid #000;">
503
+ <th><b>Model Type</b></th>
504
+ <th><b>Models</b></th>
505
+ <th><b>Book</b></th>
506
+ <th><b>Slides</b></th>
507
+ <th><b>Financial Report</b></th>
508
+ <th><b>Textbook</b></th>
509
+ <th><b>Exam Paper</b></th>
510
+ <th><b>Magazine</b></th>
511
+ <th><b>Academic Papers</b></th>
512
+ <th><b>Notes</b></th>
513
+ <th><b>Newspaper</b></th>
514
+ <th><b>Overall</b></th>
515
+ </tr>
516
+ </thead>
517
+ <tbody>
518
+ <tr>
519
+ <td rowspan="3"><b>Pipeline Tools</b></td>
520
+ <td>MinerU</td>
521
+ <td><u>0.055</u></td>
522
+ <td>0.124</td>
523
+ <td><u>0.033</u></td>
524
+ <td><u>0.102</u></td>
525
+ <td><u>0.159</u></td>
526
+ <td><b>0.072</b></td>
527
+ <td><u>0.025</u></td>
528
+ <td>0.984</td>
529
+ <td>0.171</td>
530
+ <td>0.206</td>
531
+ </tr>
532
+ <tr>
533
+ <td>Marker</td>
534
+ <td>0.074</td>
535
+ <td>0.340</td>
536
+ <td>0.089</td>
537
+ <td>0.319</td>
538
+ <td>0.452</td>
539
+ <td>0.153</td>
540
+ <td>0.059</td>
541
+ <td>0.651</td>
542
+ <td>0.192</td>
543
+ <td>0.274</td>
544
+ </tr>
545
+ <tr>
546
+ <td>Mathpix</td>
547
+ <td>0.131</td>
548
+ <td>0.220</td>
549
+ <td>0.202</td>
550
+ <td>0.216</td>
551
+ <td>0.278</td>
552
+ <td>0.147</td>
553
+ <td>0.091</td>
554
+ <td>0.634</td>
555
+ <td>0.690</td>
556
+ <td>0.300</td>
557
+ </tr>
558
+ <tr>
559
+ <td rowspan="2"><b>Expert VLMs</b></td>
560
+ <td>GOT-OCR</td>
561
+ <td>0.111</td>
562
+ <td>0.222</td>
563
+ <td>0.067</td>
564
+ <td>0.132</td>
565
+ <td>0.204</td>
566
+ <td>0.198</td>
567
+ <td>0.179</td>
568
+ <td>0.388</td>
569
+ <td>0.771</td>
570
+ <td>0.267</td>
571
+ </tr>
572
+ <tr>
573
+ <td>Nougat</td>
574
+ <td>0.734</td>
575
+ <td>0.958</td>
576
+ <td>1.000</td>
577
+ <td>0.820</td>
578
+ <td>0.930</td>
579
+ <td>0.830</td>
580
+ <td>0.214</td>
581
+ <td>0.991</td>
582
+ <td>0.871</td>
583
+ <td>0.806</td>
584
+ </tr>
585
+ <tr>
586
+ <td rowspan="3"><b>General VLMs</b></td>
587
+ <td>GPT4o</td>
588
+ <td>0.157</td>
589
+ <td>0.163</td>
590
+ <td>0.348</td>
591
+ <td>0.187</td>
592
+ <td>0.281</td>
593
+ <td>0.173</td>
594
+ <td>0.146</td>
595
+ <td>0.607</td>
596
+ <td>0.751</td>
597
+ <td>0.316</td>
598
+ </tr>
599
+ <tr>
600
+ <td>Qwen2.5-VL-7B</td>
601
+ <td>0.148</td>
602
+ <td><b>0.053</b></td>
603
+ <td>0.111</td>
604
+ <td>0.137</td>
605
+ <td>0.189</td>
606
+ <td>0.117</td>
607
+ <td>0.134</td>
608
+ <td>0.204</td>
609
+ <td>0.706</td>
610
+ <td>0.205</td>
611
+ </tr>
612
+ <tr>
613
+ <td>InternVL3-8B</td>
614
+ <td>0.163</td>
615
+ <td><u>0.056</u></td>
616
+ <td>0.107</td>
617
+ <td>0.109</td>
618
+ <td><b>0.129</b></td>
619
+ <td>0.100</td>
620
+ <td>0.159</td>
621
+ <td><b>0.150</b></td>
622
+ <td>0.681</td>
623
+ <td>0.188</td>
624
+ </tr>
625
+ <tr>
626
+ <td rowspan="2"><b>Mix</b></td>
627
+ <td>MonkeyOCR-3B <a href="https://huggingface.co/echo840/MonkeyOCR/blob/main/Structure/doclayout_yolo_docstructbench_imgsz1280_2501.pt">[Weight]</a></td>
628
+ <td><b>0.046</b></td>
629
+ <td>0.120</td>
630
+ <td><b>0.024</b></td>
631
+ <td><b>0.100</b></td>
632
+ <td><b>0.129</b></td>
633
+ <td><u>0.086</u></td>
634
+ <td><b>0.024</b></td>
635
+ <td>0.643</td>
636
+ <td><b>0.131</b></td>
637
+ <td><u>0.155</u></td>
638
+ </tr>
639
+ <tr>
640
+ <td>MonkeyOCR-3B* <a href="https://huggingface.co/echo840/MonkeyOCR/blob/main/Structure/layout_zh.pt">[Weight]</a></td>
641
+ <td>0.054</td>
642
+ <td>0.203</td>
643
+ <td>0.038</td>
644
+ <td>0.112</td>
645
+ <td>0.138</td>
646
+ <td>0.111</td>
647
+ <td>0.032</td>
648
+ <td><u>0.194</u></td>
649
+ <td><u>0.136</u></td>
650
+ <td><b>0.120</b></td>
651
+ </tr>
652
+ </tbody>
653
+ </table>
654
+
655
+ ### 3. Comparing MonkeyOCR with closed-source and extra large open-source VLMs.
656
+ <img src="https://v1.ax1x.com/2025/06/05/7jQlj4.png" alt="7jQlj4.png" border="0" />
657
+
658
+
659
+ ## Visualization Demo
660
+
661
+ Get a Quick Hands-On Experience with Our Demo: http://vlrlabmonkey.xyz:7685
662
+
663
+ > Our demo is simple and easy to use:
664
+ >
665
+ > 1. Upload a PDF or image.
666
+ > 2. Click “Parse (解析)” to let the model perform structure detection, content recognition, and relationship prediction on the input document. The final output will be a markdown-formatted version of the document.
667
+ > 3. Select a prompt and click “Test by prompt” to let the model perform content recognition on the image based on the selected prompt.
668
+
669
+
670
+
671
+
672
+ ### Example for formula document
673
+ <img src="https://v1.ax1x.com/2025/06/10/7jVLgB.jpg" alt="7jVLgB.jpg" border="0" />
674
+
675
+ ### Example for table document
676
+ <img src="https://v1.ax1x.com/2025/06/11/7jcOaa.png" alt="7jcOaa.png" border="0" />
677
+
678
+ ### Example for newspaper
679
+ <img src="https://v1.ax1x.com/2025/06/11/7jcP5V.png" alt="7jcP5V.png" border="0" />
680
+
681
+ ### Example for financial report
682
+ <img src="https://v1.ax1x.com/2025/06/11/7jc10I.png" alt="7jc10I.png" border="0" />
683
+ <img src="https://v1.ax1x.com/2025/06/11/7jcRCL.png" alt="7jcRCL.png" border="0" />
684
+
685
+ ## Citing MonkeyOCR
686
+
687
+ If you wish to refer to the baseline results published here, please use the following BibTeX entries:
688
+
689
+ ```BibTeX
690
+ @misc{li2025monkeyocrdocumentparsingstructurerecognitionrelation,
691
+ title={MonkeyOCR: Document Parsing with a Structure-Recognition-Relation Triplet Paradigm},
692
+ author={Zhang Li and Yuliang Liu and Qiang Liu and Zhiyin Ma and Ziyang Zhang and Shuo Zhang and Zidun Guo and Jiarui Zhang and Xinyu Wang and Xiang Bai},
693
+ year={2025},
694
+ eprint={2506.05218},
695
+ archivePrefix={arXiv},
696
+ primaryClass={cs.CV},
697
+ url={https://arxiv.org/abs/2506.05218},
698
+ }
699
+ ```
700
+
701
+
702
+
703
+ ## Acknowledgments
704
+ We would like to thank [MinerU](https://github.com/opendatalab/MinerU), [DocLayout-YOLO](https://github.com/opendatalab/DocLayout-YOLO), [PyMuPDF](https://github.com/pymupdf/PyMuPDF), [layoutreader](https://github.com/ppaanngggg/layoutreader), [Qwen2.5-VL](https://github.com/QwenLM/Qwen2.5-VL), [LMDeploy](https://github.com/InternLM/lmdeploy), and [InternVL3](https://github.com/OpenGVLab/InternVL) for providing base code and models, as well as their contributions to this field. We also thank [M6Doc](https://github.com/HCIILAB/M6Doc), [DocLayNet](https://github.com/DS4SD/DocLayNet), [CDLA](https://github.com/buptlihang/CDLA), [D4LA](https://github.com/AlibabaResearch/AdvancedLiterateMachinery), [DocGenome](https://github.com/Alpha-Innovator/DocGenome), [PubTabNet](https://github.com/ibm-aur-nlp/PubTabNet), and [UniMER-1M](https://github.com/opendatalab/UniMERNet) for providing valuable datasets.
705
+
706
+
707
+ ## Copyright
708
+ Please don’t hesitate to share your valuable feedback — it’s a key motivation that drives us to continuously improve our framework. The current technical report only presents the results of the 3B model. Our model is intended for non-commercial use. If you are interested in larger one, please contact us at [email protected] or [email protected].