Skip to content

Commit 1d42ad1

Browse files
authored
Same for result.py
1 parent 9a401db commit 1d42ad1

File tree

1 file changed

+1
-4
lines changed
  • paddlex/inference/models/formula_recognition

1 file changed

+1
-4
lines changed

paddlex/inference/models/formula_recognition/result.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,7 @@ def pdf2img(pdf_path: str, img_path: str, is_padding: bool = False):
283283
for page in pdfDoc:
284284
rotate = int(0)
285285
zoom = 2
286-
img = page.render(scale=zoom, rotation=rotate).to_pil()
287-
img = img.convert("RGB")
288-
img = np.array(img)
289-
img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
286+
img = page.render(scale=zoom, rotation=rotate).to_numpy()
290287
xywh = crop_white_area(img)
291288

292289
if xywh is not None:

0 commit comments

Comments
 (0)