Skip to content

PaddleOCR.pred() 推理终止 #75560

@ella-collins

Description

@ella-collins

bug描述 Describe the Bug

paddleOCR推理过程中Pycharm异常终止

`from paddleocr import PaddleOCR
from paddleocr import PPChatOCRv4Doc
from PIL import Image

def ocrTextPredict():
ocr = PaddleOCR(
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False, )

# Run OCR inference on a sample image
# image_path = "image/TIG_welding_control.png";
image_path = "image/xuanzhuan_pipe.png";
img = Image.open(image_path)
image_format = img.format
print(f"图片格式是: {image_format}")  # 输出: 图片格式是: JPEG
if image_format == "PNG":
    result = ocr.predict(input= image_path)
else :
    png_img = image_path.split(".")[0]+".png"
    print(f"PNG图片位置是: {png_img}")
    img.save(png_img, "PNG")
    result = ocr.predict(input = png_img)


# Visualize the results and save the JSON results
for res in result:
    res.print()
    res.save_to_img("output")
    res.save_to_json("output")`

Image

其他补充信息 Additional Supplementary Information

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions