PP DocLayout Plus L
PP-DocLayout_plus-L 是一個高精度的文檔佈局區域定位模型,基於 RT-DETR-L 架構訓練,支持 20 種常見文檔元素的檢測。
下載量 1,308
發布時間 : 6/6/2025
模型概述
該模型專門用於文檔圖像的佈局分析,能夠精確定位文檔中的標題、段落、表格、公式等多種元素,適用於中英文混合文檔處理。
模型特點
多類別檢測
支持檢測20種文檔元素,包括文本、標題、表格、公式等
高精度
在自建數據集上達到83.2%的mAP(0.5)指標
廣泛適用性
訓練數據涵蓋論文、PPT、合同、古籍等多種文檔類型
模型能力
文檔佈局分析
表格檢測
公式檢測
標題識別
文本區域定位
使用案例
文檔處理
學術論文分析
自動識別論文中的標題、摘要、參考文獻等結構
可生成結構化論文內容
合同解析
定位合同中的關鍵條款和簽名區域
輔助合同審查流程
教育
試卷分析
識別試卷中的題目、答案區域
輔助自動閱卷系統
🚀 PP-DocLayout_plus-L
PP-DocLayout_plus-L 是一個高精度的佈局區域定位模型,它基於 RT-DETR-L 在自建數據集上訓練得到。該數據集包含中英文論文、PPT、多佈局雜誌、合同、書籍、試卷、古籍和研究報告等。此佈局檢測模型涵蓋 20 種常見類別,如文檔標題、段落標題、文本、頁碼、摘要、表格、參考文獻、腳註、頁眉、頁腳、算法、公式、公式編號、圖像、表格、印章、圖表標題、圖表以及側邊欄文本和參考文獻列表等。
關鍵指標
模型 | mAP(0.5) (%) |
---|---|
PP-DocLayout_plus-L | 83.2 |
注意:上述精度指標的評估集為自建版本子區域檢測數據集,包含中英文論文、雜誌、報紙、研究報告、PPT、試卷和教科書等 1000 張文檔類型圖片。
🚀 快速開始
📦 安裝指南
1. 安裝 PaddlePaddle
請參考以下命令,使用 pip 安裝 PaddlePaddle:
# 適用於 CUDA11.8
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
# 適用於 CUDA12.6
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
# 適用於 CPU
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
PaddlePaddle 安裝詳情請參考 PaddlePaddle 官方網站。
2. 安裝 PaddleOCR
從 PyPI 安裝最新版本的 PaddleOCR 推理包:
python -m pip install paddleocr
💻 使用示例
基礎用法
你可以使用單個命令快速體驗其功能:
paddleocr layout_detection \
--model_name PP-DocLayout_plus-L \
-i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/N5C68HPVAI-xQAWTxpbA6.jpeg
你也可以將佈局檢測模塊的模型推理集成到你的項目中。在運行以下代碼之前,請將示例圖像下載到本地機器。
from paddleocr import LayoutDetection
model = LayoutDetection(model_name="PP-DocLayout_plus-L")
output = model.predict("N5C68HPVAI-xQAWTxpbA6.jpeg", batch_size=1, layout_nms=True)
for res in output:
res.print()
res.save_to_img(save_path="./output/")
res.save_to_json(save_path="./output/res.json")
運行後,得到的結果如下:
{'res': {'input_path': '/root/.paddlex/predict_input/N5C68HPVAI-xQAWTxpbA6.jpeg', 'page_index': None, 'boxes': [{'cls_id': 2, 'label': 'text', 'score': 0.9870168566703796, 'coordinate': [34.101395, 349.85275, 358.5929, 611.0788]}, {'cls_id': 2, 'label': 'text', 'score': 0.986599326133728, 'coordinate': [34.500305, 647.15753, 358.29437, 848.66925]}, {'cls_id': 2, 'label': 'text', 'score': 0.984662652015686, 'coordinate': [385.71417, 497.41037, 711.22656, 697.8426]}, {'cls_id': 8, 'label': 'table', 'score': 0.9841272234916687, 'coordinate': [73.76732, 105.94854, 321.95355, 298.85074]}, {'cls_id': 8, 'label': 'table', 'score': 0.983431875705719, 'coordinate': [436.95523, 105.81446, 662.71814, 313.4865]}, {'cls_id': 2, 'label': 'text', 'score': 0.9832285642623901, 'coordinate': [385.62766, 346.22888, 710.10205, 458.772]}, {'cls_id': 2, 'label': 'text', 'score': 0.9816107749938965, 'coordinate': [385.78085, 735.19293, 710.5613, 849.97656]}, {'cls_id': 6, 'label': 'figure_title', 'score': 0.9577467441558838, 'coordinate': [34.421764, 20.055021, 358.7124, 76.53721]}, {'cls_id': 6, 'label': 'figure_title', 'score': 0.9505674839019775, 'coordinate': [385.7235, 20.054104, 711.2928, 74.92819]}, {'cls_id': 0, 'label': 'paragraph_title', 'score': 0.9001894593238831, 'coordinate': [386.46353, 477.035, 699.4023, 490.07495]}, {'cls_id': 0, 'label': 'paragraph_title', 'score': 0.8846081495285034, 'coordinate': [35.413055, 627.7365, 185.58315, 640.522]}, {'cls_id': 0, 'label': 'paragraph_title', 'score': 0.8837621808052063, 'coordinate': [387.1759, 716.34235, 524.78345, 729.2588]}, {'cls_id': 0, 'label': 'paragraph_title', 'score': 0.8509567975997925, 'coordinate': [35.50049, 331.18472, 141.64497, 344.81168]}]}}
可視化圖像如下:
使用命令和參數說明詳情請參考 文檔。
高級用法
單個模型的能力有限,但由多個模型組成的管道可以提供更強的能力來解決現實場景中的難題。
PP-StructureV3
佈局分析是一種從文檔圖像中提取結構化信息的技術。PP-StructureV3 包括以下六個模塊:
- 佈局檢測模塊
- 通用 OCR 子管道
- 文檔圖像預處理子管道(可選)
- 表格識別子管道(可選)
- 印章識別子管道(可選)
- 公式識別子管道(可選)
你可以使用單個命令快速體驗 PP-StructureV3 管道:
paddleocr pp_structurev3 -i https://cdn-uploads.huggingface.co/production/uploads/63d7b8ee07cd1aa3c49a2026/KP10tiSZfAjMuwZUSLtRp.png
你只需幾行代碼即可體驗管道的推理。以 PP-StructureV3 管道為例:
from paddleocr import PPStructureV3
pipeline = PPStructureV3()
# ocr = PPStructureV3(use_doc_orientation_classify=True) # 使用 use_doc_orientation_classify 啟用/禁用文檔方向分類模型
# ocr = PPStructureV3(use_doc_unwarping=True) # 使用 use_doc_unwarping 啟用/禁用文檔去畸變模塊
# ocr = PPStructureV3(use_textline_orientation=True) # 使用 use_textline_orientation 啟用/禁用文本行方向分類模型
# ocr = PPStructureV3(device="gpu") # 使用 device 指定 GPU 進行模型推理
output = pipeline.predict("./KP10tiSZfAjMuwZUSLtRp.png")
for res in output:
res.print() ## 打印結構化預測輸出
res.save_to_json(save_path="output") ## 以 JSON 格式保存當前圖像的結構化結果
res.save_to_markdown(save_path="output") ## 以 Markdown 格式保存當前圖像的結果
管道中使用的默認模型是 PP-DocLayout_plus-L
。使用命令和參數說明詳情請參考 文檔。
📚 詳細文檔
📄 許可證
本項目採用 Apache-2.0 許可證。
Table Transformer Structure Recognition
MIT
基於PubTables1M數據集訓練的表格變換器模型,用於從非結構化文檔中提取表格結構
文字識別
Transformers

T
microsoft
1.2M
186
Trocr Small Handwritten
TrOCR是一個基於Transformer的光學字符識別模型,專門用於手寫文本圖像的識別。
文字識別
Transformers

T
microsoft
517.96k
45
Table Transformer Structure Recognition V1.1 All
MIT
基於Transformer的表格結構識別模型,用於檢測文檔中的表格結構
文字識別
Transformers

T
microsoft
395.03k
70
Trocr Large Printed
基於Transformer的光學字符識別模型,適用於單行印刷體文本識別
文字識別
Transformers

T
microsoft
295.59k
162
Texify
Texify 是一個 OCR 工具,專門用於將公式圖片和文本轉換為 LaTeX 格式。
文字識別
Transformers

T
vikp
206.53k
15
Trocr Base Printed
TrOCR是基於Transformer的光學字符識別模型,專為單行文本圖像識別設計,採用編碼器-解碼器架構
文字識別
Transformers

T
microsoft
184.84k
169
Manga Ocr Base
Apache-2.0
專為日語文本設計的光學字符識別工具,主要針對日本漫畫場景優化。
文字識別
Transformers 日語

M
kha-white
130.36k
145
Tiny Random Internvl2
專注於將圖像中的文本信息提取並轉化為可編輯的文本內容
文字識別
Safetensors
T
katuni4ka
73.27k
0
Trocr Large Handwritten
TrOCR是基於Transformer的光學字符識別模型,專為手寫文本識別設計,在IAM數據集上進行了微調。
文字識別
Transformers

T
microsoft
59.17k
115
Trocr Small Printed
TrOCR是一個基於Transformer的光學字符識別模型,適用於單行文本圖像的OCR任務。
文字識別
Transformers

T
microsoft
20.88k
40
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98