Replies: 1 comment
-
造成你在demo页面和Python代码中(使用缺省pipeline)所获得OCR识别结果差异明显,主要有以下几点可能的原因和需要设置的关键参数: ① 缺省参数设置不同是主要原因 建议在你的Python代码中,明确指定图像最大边长参数,例如: from paddlex import create_pipeline 或者在其他框架(如paddleocr原生方式)中使用: ocr = PaddleOCR(det_max_side_len=4000, ocr_version="PP-OCRv4", use_angle_cls=True) ② 在线demo可能启用了部分增强功能,而你代码中未启用 output = pipeline.predict( 你禁用了文档方向分类、图像矫正和文本线矫正等功能。而在在线demo中,这些可能默认是启用状态。如果你的预处理图像中存在旋转、仿射失真等问题,禁用这些功能会导致识别能力降低。 建议尝试将这些设置改为 True: output = pipeline.predict( ③ 模型版本一致性 你可以显式指定使用 PP-OCRv4 模型,例如使用 paddleocr 的 PaddleOCR: from paddleocr import PaddleOCR ④ 图片分辨率与压缩问题 ⑤ Demo使用了优化推理环境 总结建议:
参考相关 GitHub Issue: 如还有疑问,建议贴出本地使用参数设置完整代码,便于进一步定位。 Response generated by 🤖 feifei-bot | chatgpt-4o-latest |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
这是我在demo link上得到的结果

https://aistudio.baidu.com/community/app/91660/webUI?source=appMineRecent
但是我用缺省pipeline在python中调用结果差别很大,这是code
from paddlex import create_pipeline
pipeline = create_pipeline(pipeline="OCR")
output = pipeline.predict(
input="1.jpg",
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False,
)
for res in output:
res.print()
res.save_to_img(save_path="./output/")
res.save_to_json(save_path="./output/")
输出结果是

明显看到调用的结果和demo结果有很大差别,这里需要设置什么样的参数?
Beta Was this translation helpful? Give feedback.
All reactions