1、代码及文档
代码:https://github.com/PaddlePaddle/PaddleOCR?tab=readme-ov-file
介绍文档:https://paddlepaddle.github.io/PaddleOCR/ppocr/overview.html
2、依赖安装
在使用过程中需要安装库,可以依据代码运行过程中的提示安装。我使用的为python3.7,安装库为:

3、poppler for PDF OCR
我主要使用图片OCR以及PDF转DOCX文件,后者需要poppler,我使用的系统为windows.在此处进行下载:
https://github.com/oschwartz10612/poppler-windows/releases/tag/v24.07.0-0
解压后需要将poppler的bin路径加到系统环境变量path中
4、图像ocr代码样例:
from paddleocr import PaddleOCR, draw_ocr
# Paddleocr目前支持的多语言语种可以通过修改lang参数进行切换
# 例如`ch`, `en`, `fr`, `german`, `korean`, `japan`
ocr = PaddleOCR(use_angle_cls=True, lang="ch") # need to run only once to download and load model into memory
img_path = './doc/imgs_en/254.jpg'
result = ocr.ocr(img_path, cls
5033




被折叠的 条评论
为什么被折叠?



