使用pipeline调用UVDoc矫正模型后图像内容被截断,怎么设置参数保留全部内容?
🔎 Search before asking
- [x] I have searched the PaddleOCR Docs and found no similar bug report.
- [x] I have searched the PaddleOCR Issues and found no similar bug report.
- [x] I have searched the PaddleOCR Discussions and found no similar bug report.
🐛 Bug (问题描述)
使用pipeline调用UVDoc矫正模型后图像内容被截断,怎么设置参数保留全部内容?
` from paddlex import create_pipeline
pipeline = create_pipeline(pipeline="doc_preprocessor") output = pipeline.predict( input="doc_test_rotated.jpg", use_doc_orientation_classify=True, use_doc_unwarping=True, ) for res in output: res.print() res.save_to_img(save_path="./output/") res.save_to_json(save_path="./output/") `
在使用该方式调用时,也需要保留矫正完的所有图像,不需要截断,因为会将边缘部分带有文字的内容截断。
`
ocr = PaddleOCR(
text_detection_model_name="PP-OCRv5_mobile_det",
text_recognition_model_name="ch_SVTRv2_rec",
text_detection_model_dir=os.path.join(__dir__, "release_models/PP-OCRv5_mobile_det_finetune"),
text_recognition_model_dir=os.path.join(__dir__, "release_models/ch_SVTRv2_rec_infer"),
text_det_limit_side_len=1280,
use_doc_orientation_classify=True, # 通过 use_doc_orientation_classify 参数指定不使用文档方向分类模型
use_doc_unwarping=False, # 通过 use_doc_unwarping 参数指定不使用文本图像矫正模型
use_textline_orientation=True, # 通过 use_textline_orientation 参数指定不使用文本行方向分类模型
)
`
🏃♂️ Environment (运行环境)
使用docker镜像:ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:3.0.0-gpu-cuda12.6-cudnn9.5-trt10.5
🌰 Minimal Reproducible Example (最小可复现问题的Demo)
原图是什么样子的呢?
原图是什么样子的呢?
以下是原图:
请问,可以调整哪个参数开放以使得不截断之前的图像内容吗?
uvdoc矫正过后就是会导致坐标发生变化,应该是不好恢复的。
uvdoc矫正过后就是会导致坐标发生变化,应该是不好恢复的。
意思是矫正后没法获取全部图像内容?
矫正后只能得到矫正区域的信息,想到完整原始的图片信息,得关掉图片矫正。
矫正后只能得到矫正区域的信息,想到完整原始的图片信息,得关掉图片矫正。
我的想矫正后做一次整图OCR,如果矫正后内容有截断,就要分矫正前OCR和矫正后OCR了
这个模型应该主要针对文档图片矫正的,用在其他场景可能效果不理想。