Skip to content

Commit

Permalink
Update paddleocr.py (#10290)
Browse files Browse the repository at this point in the history
解决多次识别pdf,受第一次页面最大数量影响的bug
  • Loading branch information
livingbody authored Jul 4, 2023
1 parent 1fa3575 commit b888862
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions paddleocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,8 +532,9 @@ def ocr(self, img, det=True, rec=True, cls=True):
# for infer pdf file
if isinstance(img, list):
if self.page_num > len(img) or self.page_num == 0:
self.page_num = len(img)
imgs = img[:self.page_num]
imgs=img
else:
imgs = img[:self.page_num]
else:
imgs = [img]
if det and rec:
Expand Down

0 comments on commit b888862

Please sign in to comment.