Git Product home page Git Product logo

Comments (4)

username12021202 avatar username12021202 commented on July 18, 2024 1

Paddle: 2.6.1
PaddleOCR: commit 1ca0c22
Python: 3.8.10

from paddleocr.

SWHL avatar SWHL commented on July 18, 2024

你好,请给出你那里用的Paddle版本和PaddleOCR版本。我这里并没有复现该问题。我的环境如下:

OS: macOS M1
Python: 3.10.13
Paddle: 2.6.0
PaddleOCR: 拉取现在main分支的最新代码

from paddleocr.

SWHL avatar SWHL commented on July 18, 2024

PDF文件可以分享一下不,私发给我邮箱([email protected])就行。不方便的话,也无妨。

from paddleocr.

SWHL avatar SWHL commented on July 18, 2024

终于破案了,我用commit 1ca0c22 测试代码并不能发现上面所述问题。

但是当我尝试pip install paddleocr==2.7.3时,却可以复现这个问题了。于是我猜测题主用的并不是最新main分支代码,而是v2.7.3代码(也就是说直接通过pip install paddleocr安装的)。

paddleocr==2.7.3 关键部分代码:

PaddleOCR/paddleocr.py

Lines 764 to 768 in ddaa85d

def __call__(self, img, return_ocr_result_in_table=False, img_idx=0):
img = check_img(img)
res, _ = super().__call__(
img, return_ocr_result_in_table, img_idx=img_idx)
return res

当前commit 1ca0c22 关键部分代码:

PaddleOCR/paddleocr.py

Lines 838 to 856 in 1ca0c22

def __call__(
self,
img,
return_ocr_result_in_table=False,
img_idx=0,
alpha_color=(255, 255, 255),
):
img, flag_gif, flag_pdf = check_img(img, alpha_color)
if isinstance(img, list) and flag_pdf:
res_list = []
for index, pdf_img in enumerate(img):
logger.info("processing {}/{} page:".format(index + 1, len(img)))
res, _ = super().__call__(
pdf_img, return_ocr_result_in_table, img_idx=index
)
res_list.append(res)
return res_list
res, _ = super().__call__(img, return_ocr_result_in_table, img_idx=img_idx)
return res

从上述代码可以看到,最新代码已经对list类型做了处理,因此拉取最新main分支代码将解决该问题。

如果问题验证解决了,请题主主动关闭issue哈,感谢。

from paddleocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.