页脚有可能被识别出正文内容(已本地处理问题 #2347
Replies: 7 comments
-
|
公司网络无法上传图片,我回家再po图片 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
测试的pdf能给一份吗? |
Beta Was this translation helpful? Give feedback.
-
|
这个不太行欸,保密的数据,要掉脑袋的,但可以看看公开的技术文档,应该有的 |
Beta Was this translation helpful? Give feedback.
-
|
可以只截取有问题的两页发到我的邮箱吗? |
Beta Was this translation helpful? Give feedback.
-
|
mark一下,我本地也遇到过这种情况,用解析的时候传页眉页脚的规则,在结果中正则剔除 |
Beta Was this translation helpful? Give feedback.
-
|
自定义的函数在哪里调用了呢 |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description of the bug | 错误描述
[
在使用的过程中发现上述情况,
推测应该是layout模型错误的识别了footer类也就是category_id==2的类识别出了别的
解决方案,
在layout模型推理完一页之后进行后处理,
遍历预测结果 pred_res 中的每个item。
如果该item的 category_id 为 2,表示它需要与 abandon_bboxes 中的现有边界框合并。如果该item与某个现有边界框相近,则合并这两个边界框。如果没有找到相近的边界框,则将该边界框添加到 abandon_bboxes 中。
如果该item的 category_id 不是 2,且它与 abandon_bboxes 中的某个边界框相近,则将该item的 category_id 更新为 2。
效果如下
在docanalyze_by_custom_model.doc_analyze. custom_model(img)推理之后追加后处理即可
代码如下,如写的不足的地方欢迎随时指正
How to reproduce the bug | 如何复现
运行就会可能出现
Operating system | 操作系统
Windows
Python version | Python 版本
3.10
Software version | 软件版本 (magic-pdf --version)
1.0.x
Device mode | 设备模式
cuda
Beta Was this translation helpful? Give feedback.
All reactions