H800启动PPStructure识别np.ndarray类型pdf页面图像板面信息,返回[],但在cpu上可以正常识别 #12298
Unanswered
Desperado-Jia
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
import numpy as np
import fitz
from io import BytesIO
from PIL import Image
from paddleocr import PPStructure
table_engine = PPStructure(layout=True, table=True, ocr=True, show_log=True, lang=lang)
input_pdf_filepath = "xxx"
doc = fitz.open(filename=input_pdf_filepath)
page = doc.load_page(page_id=0)
zoom_scales = (2, 2)
pil_img = Image.open(
fp=BytesIO(fitz.utils.get_pixmap(page=page, matrix=fitz.Matrix(*zoom_scales)).pil_tobytes("jpeg")),
mode="r"
).convert(mode="RGB") #
PIL.Image.Image
page_image = np.array(pil_img)
result = table_engine(page_image)
H800GPU机器上运行,返回结果为[],但是在CPU上是正常解析结果
请尽量不要包含图片在问题中/Please try to not include the image in the issue.
Beta Was this translation helpful? Give feedback.
All reactions