PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
39.75k stars 7.38k forks source link

面版识别添加onnx支持完善 #12068

Closed heweisheng closed 1 month ago

heweisheng commented 1 month ago

发现面版识别一开onnx就出问题,看了下其他的反馈,还是修复下这个问题好点

issue tracking:

原来情况面版分析使用Onnx第一个报错:

image

第二个报错

image

image

paddle-bot[bot] commented 1 month ago

Thanks for your contribution!

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

GreatV commented 1 month ago

麻烦把相关issue也贴出来,修复前和修复后的对比也麻烦贴一下。

heweisheng commented 1 month ago

麻烦把相关issue也贴出来,修复前和修复后的对比也麻烦贴一下。

https://github.com/PaddlePaddle/PaddleOCR/issues/8028

修改前无法正常加载模型,修改后可以正常加载跟使用 具体修改参考的是table里面的onnx写法 参考paddleocr里的逻辑移除了onnx下会下载模型的行为 image

image

heweisheng commented 1 month ago

麻烦把相关issue也贴出来,修复前和修复后的对比也麻烦贴一下。

原来情况面版分析使用Onnx第一个报错: image 第二个报错 image

GreatV commented 1 month ago

麻烦提供一个最小可运行脚本,我测试一下。

heweisheng commented 1 month ago

麻烦提供一个最小可运行脚本,我测试一下。 需要使用paddle2onnx将飞浆的模型转换成onnx模型先,然后使用paddleocr命令就可以复现了 paddleocr --image_dir="c:\Users\heweisheng\Desktop\train_5001.jpg" --type=structure --recovery=true --use_onnx=True --layout_model_dir=E:\PyOcr\model\layout\picodet_lcnet_x1_0_fgd_layout_cdla_infer\inference.onnx --rec_model_dir=E:\PyOcr\model\rec\ch\ch_PP-OCRv4_rec_infer\inference.onnx --det_model_dir=E:\PyOcr\model\det\ch\ch_PP-OCRv4_det_infer\inference.onnx --table_model_dir=E:\PyOcr\model\table\ch_ppstructure_mobile_v2.0_SLANet_infer\inference.onnx

修复前: image 修复后: image