-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
页脚有可能被识别出正文内容(已本地处理问题 #1605
Labels
bug
Something isn't working
Comments
公司网络无法上传图片,我回家再po图片 |
测试的pdf能给一份吗? |
这个不太行欸,保密的数据,要掉脑袋的,但可以看看公开的技术文档,应该有的 |
可以只截取有问题的两页发到我的邮箱吗? |
mark一下,我本地也遇到过这种情况,用解析的时候传页眉页脚的规则,在结果中正则剔除 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: