We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caa334a commit 9a401dbCopy full SHA for 9a401db
paddlex/inference/utils/io/readers.py
@@ -293,11 +293,7 @@ def read_file(self, in_path):
293
doc = pdfium.PdfDocument(in_path)
294
try:
295
for page in doc:
296
- image = page.render(scale=self._scale, rotation=self._rotation).to_pil()
297
- image = image.convert("RGB")
298
- img_cv = np.array(image)
299
- img_cv = cv2.cvtColor(img_cv, cv2.COLOR_RGB2BGR)
300
- yield img_cv
+ yield page.render(scale=self._scale, rotation=self._rotation).to_numpy()
301
finally:
302
doc.close()
303
0 commit comments