CoolFace
Modelpublic

PatSnap/Hiro-Layout

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
8likes41downloads
README_zh.md213 linesDownload Raw Back to root
1---2license: apache-2.03language:4- zh5- en6pipeline_tag: object-detection7tags:8- document-ai9- document-layout-analysis10- patent11- pdf12- hiro13- patsnap14datasets:15- in-house16metrics:17- precision18- recall19- f120---21 22# Hiro-Layout:面向专利和技术 PDF 的文档版面分析模型23 24[English](README.md) | 简体中文25 26[![Hugging Face Spaces](https://img.shields.io/badge/🤗%20Spaces-Hiro--SmartDoc-yellow.svg)](https://huggingface.co/spaces/PatSnap/Hiro-SmartDoc)27 28Hiro-Layout 是一个面向专利和技术 PDF 页面图像的文档版面分析模型,用于检测并分类页面区域,包括正文、标题、页眉、页脚、表格、公式、化学式、图片、图注、搜索报告、著录页、参考文献等专利场景常见版面元素。29 30## 亮点31 32- 面向专利文档:覆盖专利 PDF 中常见的正文、图片、表格、公式、著录页、搜索报告等元素。33- 覆盖技术文档:在 Patent PDF 和 NPD PDF 两类数据上评测。34- 细粒度类别体系:共 25 个版面类别,覆盖 figure、text、complex 三组元素。35 36## 模型概览37 38| 项目 | 内容 |39| --- | --- |40| 模型名称 | Hiro-Layout |41| 当前模型文件 | `layout_model/RT-DETR_25.onnx` |42| 任务 | 文档版面分析 / 页面区域检测 |43| 输入 | PDF 页面渲染图像 |44| 输出 | 带类别标签的版面区域 |45| 领域 | 专利 PDF、技术/NPD PDF |46| 开源协议 | Apache-2.0 |47 48## 类别体系49 50| 大类 | 类别全称 | 缩写 | 中文名 |51| --- | --- | --- | --- |52| figure | graph | graph | 图表 |53| figure | drawing | draw | 绘制图 |54| figure | structure diagram | struc | 结构图 |55| figure | photograph | photo | 照片 |56| figure | table | tab | 表格 |57| figure | math equation | eqn | 数学公式 |58| figure | chemical formula | chem | 化学式 |59| figure | noise | noise | 噪声 |60| text | text | text | 文本 |61| text | title | title | 标题 |62| text | section title | sec | 章节标题 |63| text | page header | head | 页眉 |64| text | page footer | foot | 页脚 |65| text | marginal note | mnote | 边注 |66| text | caption | cap | 说明 |67| text | figure number | figno | 编号 |68| text | line number | lineno | 行号 |69| text | column number | colno | 栏号 |70| text | sequence | seq | 序列表 |71| complex | figure complex | figcx | 图片组 |72| complex | chemical reaction | rxn | 反应式 |73| complex | bibliography | bib | 著录页 |74| complex | search report | srep | 搜索报告 |75| complex | Table of Contents | toc | 目录 |76| complex | reference | ref | 参考文献 |77 78## 评测结果79 80评测指标为 Precision、Recall 和 F1。81 82| 数据集 | 人工标签数 | Precision | Recall | F1 |83| --- | ---: | ---: | ---: | ---: |84| Patent PDF | 33,054 | 0.8144 | 0.7711 | 0.7922 |85| NPD PDF | 17,769 | 0.7090 | 0.6983 | 0.7036 |86 87### Patent PDF88 89| # | 大类 | 缩写 | 类别全称 | 中文名 | 人工标签数 | Precision | Recall | F1 |90|---:|---|---|---|---|---:|---:|---:|---:|91| 1 | figure | graph | graph | 图表 | 215 | 0.7611 | 0.8000 | 0.7800 |92| 2 | figure | draw | drawing | 绘制图 | 420 | 0.8649 | 0.3048 | 0.4507 |93| 3 | figure | struc | structure diagram | 结构图 | 626 | 0.6579 | 0.8355 | 0.7361 |94| 4 | figure | photo | photograph | 照片 | 147 | 0.8378 | 0.8435 | 0.8407 |95| 5 | figure | tab | table | 表格 | 198 | 0.7759 | 0.9091 | 0.8372 |96| 6 | figure | eqn | math equation | 数学公式 | 399 | 0.7762 | 0.6692 | 0.7187 |97| 7 | figure | chem | chemical formula | 化学式 | 1,099 | 0.8792 | 0.8944 | 0.8868 |98| 8 | figure | noise | noise | 噪声 | 1,241 | 0.7025 | 0.7687 | 0.7341 |99| 9 | text | text | text | 文本 | 17,668 | 0.8182 | 0.8062 | 0.8122 |100| 10 | text | title | title | 标题 | 601 | 0.9117 | 0.8070 | 0.8561 |101| 11 | text | sec | section title | 章节标题 | 1,394 | 0.7968 | 0.7088 | 0.7502 |102| 12 | text | head | page header | 页眉 | 3,074 | 0.8187 | 0.7788 | 0.7983 |103| 13 | text | foot | page footer | 页脚 | 1,012 | 0.7432 | 0.6433 | 0.6896 |104| 14 | text | mnote | marginal note | 边注 | 421 | 0.7794 | 0.5202 | 0.6239 |105| 15 | text | cap | caption | 说明 | 80 | 0.6842 | 0.4875 | 0.5693 |106| 16 | text | figno | figure number | 编号 | 1,389 | 0.8955 | 0.7466 | 0.8143 |107| 17 | text | lineno | line number | 行号 | 341 | 0.7759 | 0.6598 | 0.7132 |108| 18 | text | colno | column number | 栏号 | 449 | 0.6964 | 0.4699 | 0.5612 |109| 19 | text | seq | sequence | 序列表 | 136 | 0.4430 | 0.2574 | 0.3256 |110| 20 | complex | figcx | figure complex | 图片组 | 1,416 | 0.8657 | 0.7373 | 0.7963 |111| 21 | complex | rxn | chemical reaction | 反应式 | 150 | 0.8898 | 0.7000 | 0.7836 |112| 22 | complex | bib | bibliography | 著录页 | 470 | 0.9615 | 0.7979 | 0.8721 |113| 23 | complex | srep | search report | 搜索报告 | 106 | 0.9052 | 0.9906 | 0.9459 |114| 24 | complex | toc | Table of Contents | 目录 | 0 | 0.0000 | 0.0000 | 0.0000 |115| 25 | complex | ref | reference | 参考文献 | 2 | 0.0000 | 0.0000 | 0.0000 |116| ALL |  |  |  |  | 33,054 | 0.8144 | 0.7711 | 0.7922 |117 118### NPD PDF119 120| # | 大类 | 缩写 | 类别全称 | 中文名 | 人工标签数 | Precision | Recall | F1 |121|---:|---|---|---|---|---:|---:|---:|---:|122| 1 | figure | graph | graph | 图表 | 248 | 0.6838 | 0.6976 | 0.6906 |123| 2 | figure | draw | drawing | 绘制图 | 9 | 0.0000 | 0.0000 | 0.0000 |124| 3 | figure | struc | structure diagram | 结构图 | 341 | 0.7454 | 0.7126 | 0.7286 |125| 4 | figure | photo | photograph | 照片 | 82 | 0.6071 | 0.6220 | 0.6145 |126| 5 | figure | tab | table | 表格 | 209 | 0.7533 | 0.8182 | 0.7844 |127| 6 | figure | eqn | math equation | 数学公式 | 298 | 0.6789 | 0.5604 | 0.6140 |128| 7 | figure | chem | chemical formula | 化学式 | 388 | 0.7324 | 0.8325 | 0.7793 |129| 8 | figure | noise | noise | 噪声 | 695 | 0.4823 | 0.4302 | 0.4548 |130| 9 | text | text | text | 文本 | 9,119 | 0.6943 | 0.7625 | 0.7268 |131| 10 | text | title | title | 标题 | 304 | 0.7130 | 0.5395 | 0.6142 |132| 11 | text | sec | section title | 章节标题 | 1,539 | 0.7337 | 0.6160 | 0.6697 |133| 12 | text | head | page header | 页眉 | 1,246 | 0.7464 | 0.7111 | 0.7283 |134| 13 | text | foot | page footer | 页脚 | 1,339 | 0.7711 | 0.6468 | 0.7035 |135| 14 | text | mnote | marginal note | 边注 | 190 | 0.5714 | 0.2947 | 0.3889 |136| 15 | text | cap | caption | 说明 | 573 | 0.8711 | 0.5899 | 0.7034 |137| 16 | text | figno | figure number | 编号 | 149 | 0.6078 | 0.4161 | 0.4940 |138| 17 | text | lineno | line number | 行号 | 41 | 0.6667 | 0.9268 | 0.7755 |139| 18 | text | colno | column number | 栏号 | 0 | 0.0000 | 0.0000 | 0.0000 |140| 19 | text | seq | sequence | 序列表 | 18 | 0.7000 | 0.3889 | 0.5000 |141| 20 | complex | figcx | figure complex | 图片组 | 734 | 0.7657 | 0.7480 | 0.7567 |142| 21 | complex | rxn | chemical reaction | 反应式 | 36 | 0.8947 | 0.4722 | 0.6182 |143| 22 | complex | bib | bibliography | 著录页 | 0 | 0.0000 | 0.0000 | 0.0000 |144| 23 | complex | srep | search report | 搜索报告 | 3 | 0.4286 | 1.0000 | 0.6000 |145| 24 | complex | toc | Table of Contents | 目录 | 76 | 0.8475 | 0.6579 | 0.7407 |146| 25 | complex | ref | reference | 参考文献 | 132 | 0.8148 | 0.3333 | 0.4731 |147| ALL |  |  |  |  | 17,769 | 0.7090 | 0.6983 | 0.7036 |148 149## 在线演示150 151Hiro-Layout 已集成到 Hiro-Smart-Doc 中,用于完整文档版面分析与 OCR。可以在 Hugging Face Spaces 上直接体验在线演示:152 153[PatSnap/Hiro-SmartDoc](https://huggingface.co/spaces/PatSnap/Hiro-SmartDoc)154 155## 使用方式156 157当前模型文件是 ONNX 导出:158 159```text160layout_model/RT-DETR_25.onnx161```162 163先从 Hugging Face Hub 下载仓库,再使用 ONNXRuntime 加载模型:164 165```python166from pathlib import Path167 168from huggingface_hub import snapshot_download169import onnxruntime as ort170 171repo_dir = snapshot_download("PatSnap/Hiro-Layout")172model_path = Path(repo_dir) / "layout_model" / "RT-DETR_25.onnx"173 174session = ort.InferenceSession(str(model_path))175print("inputs:", [i.name for i in session.get_inputs()])176print("outputs:", [o.name for o in session.get_outputs()])177```178 17925 类标签映射见 `labels.json`。180 181## 文件说明182 183| 文件 | 用途 |184| --- | --- |185| `README.md` | 英文 Hugging Face 模型卡 |186| `README_zh.md` | 中文模型卡 |187| `config.json` | Hugging Face Hub 工具和下载统计使用的模型元数据 |188| `EVALUATION.md` | 从 Excel 整理出的详细评测结果 |189| `labels.json` | 机器可读的 25 类标签映射 |190| `layout_model/RT-DETR_25.onnx` | ONNX 模型文件 |191| `requirements.txt` | ONNX 加载和图像预处理的最小依赖 |192| `LICENSE` | Apache-2.0 协议 |193| `DISCLAIMER.md` | 模型限制和负责任使用说明 |194| `NOTICE` | 版权和商标声明 |195| `OPEN_SOURCE_CHECKLIST.md` | 正式公开前检查清单 |196 197## 限制198 199- 低分辨率扫描件、大角度旋转页面、手写文档、非常规版式或未覆盖模板可能导致检测不准。200- 少样本类别的指标波动较大,不能仅凭单类指标判断泛化能力。201- 法律、合规、归档、对客展示等高风险场景应保留人工复核。202- 用户需确保对所处理和分享的文档拥有相应权利。203 204## 协议205 206本项目采用 Apache License 2.0 开源协议,详见 [LICENSE](LICENSE)。207 208## 版权声明209 210Copyright (c) 2026 Patsnap. All rights reserved except as expressly licensed under the applicable license terms.211 212Hiro-Layout、Hiro、Patsnap 以及相关名称、标识、产品名、服务名、设计和标语是 Patsnap 或其关联公司的商标或注册商标。除非另有明确说明,开源协议或模型协议不授予任何商标许可。213