RT DETR L Wireless Table Cell Det
RT-DETR-L_wireless_table_cell_det 是一个高精度的表格单元格检测模型,专为表格识别任务设计,能够准确定位和标记表格图像中的每个单元格区域。
下载量 1,144
发布时间 : 6/6/2025
模型简介
该模型是表格识别任务的关键组成部分,负责定位和标记表格图像中的每个单元格区域,其性能直接影响整个表格识别过程的准确性和效率。
模型特点
高精度检测
模型在表格单元格检测任务中具有较高的准确率,Top1 Acc 达到 82.7%。
多模式推理
支持 GPU 和 CPU 推理,并且提供常规模式和高性能模式,满足不同场景的需求。
丰富的管道
提供通用表格识别 V2 管道和 PP-StructureV3 管道,可解决复杂的表格识别问题。
模型能力
表格单元格检测
多模式推理
表格识别
使用案例
文档处理
表格识别
从图像中提取表格信息并以 HTML 或 Excel 格式输出。
高精度识别表格结构和内容。
办公自动化
报销单据处理
自动识别和提取报销单据中的表格信息。
提高办公效率,减少人工输入错误。
🚀 RT-DETR-L_wireless_table_cell_det
表格单元格检测模块是表格识别任务的关键组成部分,负责定位和标记表格图像中的每个单元格区域,其性能直接影响整个表格识别过程的准确性和效率。
🚀 快速开始
本项目提供了表格单元格检测模型 RT-DETR-L_wireless_table_cell_det
,同时介绍了相关的安装步骤、使用示例以及不同的使用管道,帮助你快速上手表格识别任务。
✨ 主要特性
- 高精度检测:
RT-DETR-L_wireless_table_cell_det
模型在表格单元格检测任务中具有较高的准确率,Top1 Acc 达到 82.7%。 - 多模式推理:支持 GPU 和 CPU 推理,并且提供常规模式和高性能模式,满足不同场景的需求。
- 丰富的管道:提供通用表格识别 V2 管道和 PP-StructureV3 管道,可解决复杂的表格识别问题。
📦 安装指南
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 table_cells_detection \
--model_name RT-DETR-L_wireless_table_cell_det \
-i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/6rfhb-CXOHowonjpBsaUJ.png
你也可以将表格分类模块的模型推理集成到你的项目中。在运行以下代码之前,请将示例图像下载到本地:
from paddleocr import TableCellsDetection
model = TableCellsDetection(model_name="RT-DETR-L_wireless_table_cell_det")
output = model.predict("6rfhb-CXOHowonjpBsaUJ.png", threshold=0.3, batch_size=1)
for res in output:
res.print(json_format=False)
res.save_to_img("./output/")
res.save_to_json("./output/res.json")
运行后,得到的结果如下:
{'res': {'input_path': '6rfhb-CXOHowonjpBsaUJ.png', 'page_index': None, 'boxes': [{'cls_id': 0, 'label': 'cell', 'score': 0.9398849606513977, 'coordinate': [54.36941, 112.458046, 199.20259, 148.8335]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9389436841011047, 'coordinate': [54.376297, 38.66652, 200.09431, 75.04275]}, {'cls_id': 0, 'label': 'cell', 'score': 0.93695068359375, 'coordinate': [54.526768, 75.07727, 199.69261, 112.47577]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9276502132415771, 'coordinate': [256.82742, 112.23729, 327.20367, 148.69609]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9260919690132141, 'coordinate': [392.2286, 112.35808, 494.87323, 148.67969]}, {'cls_id': 0, 'label': 'cell', 'score': 0.926089882850647, 'coordinate': [55.078747, 148.77213, 198.78673, 181.62665]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9243109822273254, 'coordinate': [256.32922, 74.816475, 327.04968, 112.294014]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9232685565948486, 'coordinate': [54.62298, 6.616625, 199.83049, 38.849678]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9232298135757446, 'coordinate': [327.01968, 112.26065, 392.36826, 148.74333]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9225671291351318, 'coordinate': [256.76163, 39.040295, 326.9102, 74.86264]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9212655425071716, 'coordinate': [326.59286, 74.8661, 392.7218, 112.223015]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9207153916358948, 'coordinate': [392.2682, 74.9181, 494.8996, 112.21204]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9201209545135498, 'coordinate': [393.05807, 39.280144, 494.52887, 74.76607]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9167036414146423, 'coordinate': [326.6303, 38.908886, 392.46747, 74.80093]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9165226817131042, 'coordinate': [198.91599, 112.36962, 256.72226, 148.70464]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9159488081932068, 'coordinate': [200.06506, 38.73822, 256.86224, 74.968956]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9144055843353271, 'coordinate': [199.15344, 74.948166, 256.92688, 112.3458]}, {'cls_id': 0, 'label': 'cell', 'score': 0.909517228603363, 'coordinate': [256.9021, 148.65999, 327.34952, 180.787]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9079439043998718, 'coordinate': [392.5967, 148.63753, 494.56372, 180.72824]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9076585173606873, 'coordinate': [393.64462, 6.3321157, 494.12646, 38.97421]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9043015837669373, 'coordinate': [256.7985, 6.373327, 326.6927, 39.124607]}, {'cls_id': 0, 'label': 'cell', 'score': 0.9015249609947205, 'coordinate': [327.21558, 148.66805, 392.69656, 180.74384]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8990758061408997, 'coordinate': [199.04855, 6.3791466, 256.9587, 38.893078]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8976367712020874, 'coordinate': [326.987, 6.264301, 393.08954, 39.058624]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8959962129592896, 'coordinate': [198.89633, 148.7314, 256.86224, 181.1719]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8942931294441223, 'coordinate': [7.233109, 112.34024, 55.069206, 148.63686]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8866638541221619, 'coordinate': [7.6031237, 75.04754, 54.86649, 112.31445]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8835263848304749, 'coordinate': [7.8346314, 38.471584, 54.338577, 75.0842]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8768432140350342, 'coordinate': [6.3656106, 148.65721, 55.30119, 181.48982]}, {'cls_id': 0, 'label': 'cell', 'score': 0.8766786456108093, 'coordinate': [8.270618, 6.590586, 54.000782, 38.58467]}]}}
可视化图像如下:
使用命令和参数说明详情请参考 文档。
高级用法
单个模型的能力有限,但由多个模型组成的管道可以提供更强的能力,以解决现实场景中的难题。
通用表格识别 V2 管道
通用表格识别 V2 管道用于解决表格识别任务,通过从图像中提取信息并以 HTML 或 Excel 格式输出。管道中包含 8 个模块:
- 表格分类模块
- 表格结构识别模块
- 表格单元格检测模块
- 文本检测模块
- 文本识别模块
- 布局区域检测模块(可选)
- 文档图像方向分类模块(可选)
- 文本图像去畸变模块(可选) 运行以下命令可快速体验通用表格识别 V2 管道:
paddleocr table_recognition_v2 -i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/mabagznApI1k9R8qFoTLc.png \
--use_doc_orientation_classify False \
--use_doc_unwarping False \
--save_path ./output \
--device gpu:0
结果将打印到终端:
{'res': {'input_path': 'mabagznApI1k9R8qFoTLc.png', 'page_index': None, 'model_settings': {'use_doc_preprocessor': False, 'use_layout_detection': True, 'use_ocr_model': True}, 'layout_det_res': {'input_path': None, 'page_index': None, 'boxes': [{'cls_id': 8, 'label': 'table', 'score': 0.86655592918396, 'coordinate': [0.0125130415, 0.41920784, 1281.3737, 585.3884]}]}, 'overall_ocr_res': {'input_path': None, 'page_index': None, 'model_settings': {'use_doc_preprocessor': False, 'use_textline_orientation': False}, 'dt_polys': array([[[ 9, 21],
...,
[ 9, 59]],
...,
[[1046, 536],
...,
[1046, 573]]], dtype=int16), 'text_det_params': {'limit_side_len': 960, 'limit_type': 'max', 'thresh': 0.3, 'box_thresh': 0.6, 'unclip_ratio': 2.0}, 'text_type': 'general', 'textline_orientation_angles': array([-1, ..., -1]), 'text_rec_score_thresh': 0, 'rec_texts': ['部门', '报销人', '报销事由', '批准人:', '单据', '张', '合计金额', '元', '车费票', '其', '火车费票', '飞机票', '中', '旅住宿费', '其他', '补贴'], 'rec_scores': array([0.99958128, ..., 0.99317062]), 'rec_polys': array([[[ 9, 21],
...,
[ 9, 59]],
...,
[[1046, 536],
...,
[1046, 573]]], dtype=int16), 'rec_boxes': array([[ 9, ..., 59],
...,
[1046, ..., 573]], dtype=int16)}, 'table_res_list': [{'cell_box_list': [array([ 0.13052222, ..., 73.08310249]), array([104.43082511, ..., 73.27777413]), array([319.39041221, ..., 73.30439308]), array([424.2436837 , ..., 73.44736794]), array([580.75836265, ..., 73.24003914]), array([723.04370201, ..., 73.22717598]), array([984.67315757, ..., 73.20420387]), array([1.25130415e-02, ..., 5.85419208e+02]), array([984.37072837, ..., 137.02281502]), array([984.26586998, ..., 201.22290352]), array([984.24017417, ..., 585.30775765]), array([1039.90606773, ..., 265.44664314]), array([1039.69549644, ..., 329.30540779]), array([1039.66546714, ..., 393.57319954]), array([1039.5122689 , ..., 457.74644783]), array([1039.55535972, ..., 521.73030403]), array([1039.58612144, ..., 585.09468392])], 'pred_html': '<html><body><table><tbody><tr><td>部门</td><td></td><td>报销人</td><td></td><td>报销事由</td><td></td><td colspan="2">批准人:</td></tr><tr><td colspan="6" rowspan="8"></td><td colspan="2">单据 张</td></tr><tr><td colspan="2">合计金额 元</td></tr><tr><td rowspan="6">其 中</td><td>车费票</td></tr><tr><td>火车费票</td></tr><tr><td>飞机票</td></tr><tr><td>旅住宿费</td></tr><tr><td>其他</td></tr><tr><td>补贴</td></tr></tbody></table></body></html>', 'table_ocr_pred': {'rec_polys': array([[[ 9, 21],
...,
[ 9, 59]],
...,
[[1046, 536],
...,
[1046, 573]]], dtype=int16), 'rec_texts': ['部门', '报销人', '报销事由', '批准人:', '单据', '张', '合计金额', '元', '车费票', '其', '火车费票', '飞机票', '中', '旅住宿费', '其他', '补贴'], 'rec_scores': array([0.99958128, ..., 0.99317062]), 'rec_boxes': array([[ 9, ..., 59],
...,
[1046, ..., 573]], dtype=int16)}}]}}
如果指定了 save_path
,可视化结果将保存到 save_path
目录下。可视化输出如下:
命令行方法适用于快速体验。对于项目集成,也只需几行代码:
from paddleocr import TableRecognitionPipelineV2
pipeline = TableRecognitionPipelineV2(
use_doc_orientation_classify=False, # 使用 use_doc_orientation_classify 启用/禁用文档方向分类模型
use_doc_unwarping=False, # 使用 use_doc_unwarping 启用/禁用文档去畸变模块
)
# pipeline = TableRecognitionPipelineV2(use_doc_orientation_classify=True) # 使用 use_doc_orientation_classify 指定是否使用文档方向分类模型
# pipeline = TableRecognitionPipelineV2(use_doc_unwarping=True) # 使用 use_doc_unwarping 指定是否使用文本图像去畸变模块
# pipeline = TableRecognitionPipelineV2(device="gpu") # 使用 device 指定使用 GPU 进行模型推理
output = pipeline.predict("https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/mabagznApI1k9R8qFoTLc.png")
for res in output:
res.print() ## 打印预测的结构化输出
res.save_to_img("./output/")
res.save_to_xlsx("./output/")
res.save_to_html("./output/")
res.save_to_json("./output/")
使用命令和参数说明详情请参考 文档。
PP-StructureV3
布局分析是一种从文档图像中提取结构化信息的技术。PP-StructureV3 包含以下六个模块:
- 布局检测模块
- 通用 OCR 管道
- 文档图像预处理管道(可选)
- 表格识别管道(可选)
- 印章识别管道(可选)
- 公式识别管道(可选) 运行以下命令可快速体验 PP-StructureV3 管道:
paddleocr pp_structurev3 -i https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/mG4tnwfrvECoFMu-S9mxo.png \
--use_doc_orientation_classify False \
--use_doc_unwarping False \
--use_textline_orientation False \
--device gpu:0
结果将打印到终端。如果指定了 save_path
,结果将保存到 save_path
目录下。
只需几行代码即可体验管道推理。以 PP-StructureV3 管道为例:
from paddleocr import PPStructureV3
pipeline = PPStructureV3(
use_doc_orientation_classify=False, # 使用 use_doc_orientation_classify 启用/禁用文档方向分类模型
use_doc_unwarping=False, # 使用 use_doc_unwarping 启用/禁用文档去畸变模块
use_textline_orientation=False, # 使用 use_textline_orientation 启用/禁用文本行方向分类模型
device="gpu:0", # 使用 device 指定使用 GPU 进行模型推理
)
output = pipeline.predict("./pp_structure_v3_demo.png")
for res in output:
res.print() # 打印结构化预测输出
res.save_to_json(save_path="output") ## 以 JSON 格式保存当前图像的结构化结果
res.save_to_markdown(save_path="output") ## 以 Markdown 格式保存当前图像的结果
使用命令和参数说明详情请参考 文档。
📚 详细文档
属性 | 详情 |
---|---|
模型类型 | RT-DETR-L_wireless_table_cell_det |
训练数据 | 未提及 |
📄 许可证
本项目采用 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
Trocr Large Handwritten
TrOCR是基于Transformer的光学字符识别模型,专为手写文本识别设计,在IAM数据集上进行了微调。
文字识别
Transformers

T
microsoft
59.17k
115
Trocr Small Printed
TrOCR是一个基于Transformer的光学字符识别模型,适用于单行文本图像的OCR任务。
文字识别
Transformers

T
microsoft
20.88k
40
Lilt Roberta En Base
MIT
语言无关版式变换器(LiLT)通过将预训练的RoBERTa(英文)与预训练的语言无关版式变换器(LiLT)拼接,为任何语言提供类似LayoutLM的模型。
文字识别
Transformers

L
SCUT-DLVCLab
12.05k
19
精选推荐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