1、PaddleOCR是基于深度学习的ocr识别库,中文识别精度相当还不错,能够应对大多数文字提取需求。
2、需要依次安装三个依赖库,shapely库可能会受到系统的影响,出现安装错误。
pip install paddlepaddle pip install shapely pip install paddleocr
ocr = PaddleOCR(use_angle_cls=True,)
# 输入待识别图片路径
img_path = r"d:\Desktop\4A34A16F-6B12-4ffc-88C6-FC86E4DF6912.png"
# 输出结果保存路径
result = ocr.ocr(img_path, cls=True)
for line in result:
print(line)
from PIL import Image
image = Image.open(img_path).convert('RGB')
boxes = [line[0] for line in result]
txts = [line[1][0] for line in result]
scores = [line[1][1] for line in result]
im_show = draw_ocr(image, boxes, txts, scores)
im_show = Image.fromarray(im_show)
im_show.show()
内容扩展:
PaddleOCR旨在打造一套丰富、领先、且实用的OCR工具库,助力使用者训练出更好的模型,并应用落地。
到此这篇关于python PaddleOCR库用法及知识点详解的文章就介绍到这了,更多相关python PaddleOCR库的介绍内容请搜索趣讯吧以前的文章或继续浏览下面的相关文章希望大家以后多多支持趣讯吧!