MinerU
MinerU copied to clipboard
有些规则类的直接识别成了文字,能不能保持一个原图,不然结构全丢失了
🔎 Search before asking | 提交之前请先搜索
- [x] I have searched the MinerU Readme and found no similar bug report.
- [x] I have searched the MinerU Issues and found no similar bug report.
- [x] I have searched the MinerU Discussions and found no similar bug report.
🤖 Consult the online AI assistant for assistance | 在线 AI 助手咨询
- [x] I have consulted the online AI assistant but was unable to obtain a solution to the issue.
Description of the bug | 错误描述
How to reproduce the bug | 如何复现
SWM341 MCU数据手册.pdf
Operating System Mode | 操作系统类型
No response
Operating System Version| 操作系统版本
minerU2.5
Python version | Python 版本
No response
Software version | 软件版本 (mineru --version)
No response
Backend name | 解析后端
No response
Device mode | 设备模式
No response
MinerU 目前没有内置选项可以自动将所有“规则类”(如线条、框、结构性图形)以图片或原图形式保留在结构化输出(如 Markdown/JSON)中。这类元素在复杂文档中经常被误识别为文本,导致结构丢失,是已知局限相关说明。
不过,你可以考虑以下变通方法:
- 启用
--f-dump-orig-pdf(或相关参数),MinerU 会在输出目录保留一份原始 PDF 文件,便于后续人工或脚本对照结构相关代码。 - MinerU 的 pipeline 后端在解析时会对图片、表格等区域进行截图(如
cut_image_and_table),这些区域的原始像素会保存在中间数据(如 middle.json 及图片文件夹)中,但“规则类”如果被误判为文本则不会单独保留为图片相关实现。 - 如果需要完整保留页面原貌,可直接用第三方工具将 PDF 页渲染为图片(如 pypdfium2、pdf2image),与 MinerU 的结构化结果配合使用。
- 对于极端复杂的结构,建议结合 MinerU 的 discarded_blocks 区域、原始 PDF、以及自动/手动后处理脚本,最大程度还原版面。
目前如需自动将所有页面原图或指定区域图片嵌入结构化输出,需要定制开发(比如在 middle.json 里增加原图 base64 字段,或在 markdown 里插入整页图片)。如果你有开发需求,可以基于 pipeline 的图片裁剪和输出逻辑扩展实现。
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
上面被识别成文本是在minerU2.5在线平台测的,但是在huggingface上面测试效果是图
有源文件吗