Image-Text-to-Text
Transformers
Safetensors
youtu_vl
text-generation
conversational
custom_code
File size: 6,185 Bytes
c13c3aa
 
 
 
 
 
 
b82ee76
c13c3aa
 
 
 
 
 
6785cea
c13c3aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6785cea
 
 
 
c13c3aa
 
 
 
 
 
5c0af68
 
 
 
c13c3aa
 
 
 
 
 
 
 
 
 
 
 
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
---
license: other
license_name: youtu-parsing
license_link: https://huggingface.co/tencent/Youtu-Parsing/blob/main/LICENSE.txt
pipeline_tag: image-text-to-text
base_model:
  - tencent/Youtu-LLM-2B
library_name: transformers
base_model_relation: finetune
---
<div align="center">

# <img src="assets/youtu-parsing-logo.png" alt="Youtu-Parsing Logo" height="100px">

[πŸ“ƒ License](https://huggingface.co/tencent/Youtu-Parsing/blob/main/LICENSE.txt) β€’ [πŸ‘¨β€πŸ’» Code](https://github.com/TencentCloudADP/youtu-parsing) β€’ [πŸ–₯️ Demo](https://huggingface.co/spaces/Tencent/Youtu-Parsing) β€’ [πŸ“‘ Technical Report](https://arxiv.org/abs/2601.20430) β€’ [πŸ“Š Benchmarks](#benchmarks) β€’ [πŸš€ Getting Started](#quickstart)

</div>

<div align="center">
<img src="./assets/static_v40.png" width="800"/>
</div>


## 🎯 Introduction

**Youtu-Parsing** is a specialized document parsing model built upon the open-source Youtu-LLM 2B foundation. By extending the capabilities of the base model with a prompt-guided framework and NaViT-style dynamic visual encoder, Youtu-Parsing offers enhanced parsing capabilities for diverse document elements including text, tables, formulas, and charts. The model incorporates an efficient parallel decoding mechanism that significantly accelerates inference, making it practical for real-world document analysis applications. We share Youtu-Parsing with the community to facilitate research and development in document understanding.


## ✨ Key Features
### πŸ“„ **Document Structure Preservation**
- **Text Localization**: Accurately detects and localizes text regions with pixel-level precision, ensuring no content is missed or misplaced across diverse document layouts.
- **Reading Order Restoration**: Intelligently reconstructs the logical reading sequence of document content, maintaining proper flow across columns, sections, and pages for coherent understanding.

### πŸ“Š **Advanced Content Recognition**
- **Text Recognition**: Provides precise text recognition across diverse scenarios.
- **Formula Recognition**: Automatically converts mathematical expressions to LaTeX format.
- **Table Recognition**: Automatically detects tables and converts them to HTML format.
- **Chart Recognition**: Converts charts to markdown tables, mind maps and flow charts to mermaid format.

### ⚑ **High-Performance Inference**
- **Token Parallelism**: Enables simultaneous inference of multiple tokens for accelerated processing, achieving 5-11x speedup.
- **Query Parallelism**: Combines multiple queries together to maximize Token Parallelism benefits, providing an additional 2x speedup on top of Token Parallelism acceleration.

<div align="center">
<img src="./assets/parallel_decoder.png" width="800"/>
</div>

<a id="benchmarks"></a>

## πŸ“Š Performance
### 1. OminiDocBench v1.5

<div align="center">
<img src="./assets/OminiDocBench_v1.5.png" width="800"/>
</div>

### 2. olmOCR
<div align="center">
<img src="./assets/olmOCR.png" width="800"/>
</div>


<a id="quickstart"></a>

## πŸš€ Quick Start
### Install packages
```bash
conda create -n youtu_parsing python=3.10
conda activate youtu_parsing
pip install git+https://github.com/TencentCloudADP/youtu-parsing.git#subdirectory=youtu_hf_parser

# install the flash-attn2
# For CUDA 12.x + PyTorch 2.6 + Python 3.10 + Linux x86_64:
pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl

# Alternative: Install from PyPI
pip install flash-attn==2.7.0
```

### Usage with transformers
```python
from youtu_hf_parser import YoutuOCRParserHF

# Initialize the parser
parser = YoutuOCRParserHF(
    model_path=model_path,
    enable_angle_correct=True,  # Set to False to disable angle correction
    angle_correct_model_path=angle_correct_model_path
)

# Parse an image
parser.parse_file(input_path=image_path, output_dir=output_dir)
```

## 🎨 Visualization
### Text Recognition
<div align="center">
<img src="./assets/handwriting.png" width="800"/>
</div>

<div align="center">
<img src="./assets/art.png" width="800"/>
</div>

<div align="center">
<img src="./assets/printed.png" width="800"/>
</div>

### Formula Recognition
<div align="center">
<img src="./assets/formula.png" width="800"/>
</div>

### Table Recognition
<div align="center">
<img src="./assets/wired.png" width="800"/>
</div>

<div align="center">
<img src="./assets/wireless.png" width="800"/>
</div>

### Chart Recognition
<div align="center">
<img src="./assets/chart.png" width="800"/>
</div>

<div align="center">
<img src="./assets/chart2.png" width="800"/>
</div>


## 🀝 Acknowledgements
We would like to thank [Youtu-LLM](https://github.com/TencentCloudADP/youtu-tip/tree/master/youtu-llm), [OmniDocBench](https://github.com/opendatalab/OmniDocBench), [olmOCR](https://github.com/allenai/olmocr), [dots.ocr](https://github.com/rednote-hilab/dots.ocr), [MinerU](https://github.com/opendatalab/MinerU), [PaddleOCR](https://github.com/PaddlePaddle/PaddleOCR), [PSENet](https://github.com/whai362/PSENet) for providing model weights, benchmarks and valuable code. We also appreciate everyone's contribution to this open-source project!



## πŸ“š Citation

If you find our work useful in your research, please consider citing the following paper:
```
@article{youtu-parsing,
  title={Youtu-Parsing: Perception, Structuring and Recognition via High-Parallelism Decoding},
  author={Tencent Youtu Lab},
  year={2026},
  eprint={2601.20430},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  url={https://arxiv.org/abs/2601.20430}, 
}

@article{youtu-vl,
  title={Youtu-VL: Unleashing Visual Potential via Unified Vision-Language Supervision},
  author={Tencent Youtu Lab},
  year={2026},
  eprint={2601.19798},
  archivePrefix={arXiv},
  primaryClass={cs.CV},
  url={https://arxiv.org/abs/2601.19798}, 
}

@article{youtu-llm,
  title={Youtu-LLM: Unlocking the Native Agentic Potential for Lightweight Large Language Models},
  author={Tencent Youtu Lab},
  year={2025},
  eprint={2512.24618},
  archivePrefix={arXiv},
  primaryClass={cs.CL},
  url={https://arxiv.org/abs/2512.24618}, 
}
```