Skip to content
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

PP-StructureV3产线指定useGeneralOcr: false时会失败 #3744

Open
4 tasks done
endyul opened this issue Mar 28, 2025 · 1 comment
Open
4 tasks done

PP-StructureV3产线指定useGeneralOcr: false时会失败 #3744

endyul opened this issue Mar 28, 2025 · 1 comment

Comments

@endyul
Copy link

endyul commented Mar 28, 2025

Checklist:

描述问题

使用PP-StructureV3产线时,只需要版面区域检测(PP-DocLayout)结果,遂请求时指定useGeneralOcr: false。此时发现执行会失败。请求参数如下:

{
    "file": "{{ 文件 }}",
    "fileType": 1,
    "useDocOrientationClassify": false,
    "useDocUnwarping": false,
    "useTextlineOrientation": false,
    "useGeneralOcr": false,
    "useSealRecognition": false,
    "useTableRecognition": false,
    "useFormulaRecognition": false
}

check了下源码,当useGeneralOcr: false时,这里设置了overall_ocr_res = {}https://github.com/PaddlePaddle/PaddleX/blob/release/3.0-rc/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py#L564

但是后续相关逻辑还是会去获取ocr的结果,例如:

  File "/root/PaddleX/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py", line 567, in predict
    overall_ocr_res["rec_labels"] = ["text"] * len(overall_ocr_res["rec_texts"])
  File "/root/PaddleX/paddlex/inference/pipelines/layout_parsing/utils.py", line 85, in get_sub_regions_ocr_res
    overall_text_boxes = overall_ocr_res["rec_boxes"]

复现

  1. 您是否已经正常运行我们提供的教程

yes

  1. 您是否在教程的基础上修改代码内容?还请您提供运行的代码

no

  1. 您使用的数据集是?

unrelated to the current issue

  1. 请提供您出现的报错信息及相关log
  File "/root/PaddleX/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py", line 567, in predict
    overall_ocr_res["rec_labels"] = ["text"] * len(overall_ocr_res["rec_texts"])
  File "/root/PaddleX/paddlex/inference/pipelines/layout_parsing/utils.py", line 85, in get_sub_regions_ocr_res
    overall_text_boxes = overall_ocr_res["rec_boxes"]

环境

  1. 请提供您使用的PaddlePaddle和PaddleX的版本号

ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/paddlex:paddlex3.0.0rc0-paddlepaddle3.0.0rc0-gpu-cuda11.8-cudnn8.6-trt8.5

  1. 请提供您使用的操作系统信息,如Linux/Windows/MacOS

linux

  1. 请问您使用的Python版本是?

3.10

  1. 请问您使用的CUDA/cuDNN的版本号是?

ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlex/paddlex:paddlex3.0.0rc0-paddlepaddle3.0.0rc0-gpu-cuda11.8-cudnn8.6-trt8.5

@cuicheng01
Copy link
Collaborator

收到,感谢反馈,这个会在下一版修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants