• 技术文章 >Python技术 >Python基础教程

    python PaddleOCR库的介绍

    小妮浅浅小妮浅浅2021-07-17 14:38:13原创5229

    说明

    1、PaddleOCR是基于深度学习的ocr识别库,中文识别精度相当还不错,能够应对大多数文字提取需求。

    2、需要依次安装三个依赖库,shapely库可能会受到系统的影响,出现安装错误。

    安装命令

    1

    2

    3

    pip install paddlepaddle

    pip install shapely

    pip install paddleocr

    代码实现

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    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()

    以上就是python PaddleOCR库的介绍,希望对大家有所帮助。更多Python学习指路:python基础教程

    专题推荐:python paddleocr
    上一篇:python pytesseract库是什么 下一篇:python EasyOCR库是什么

    相关文章推荐

    • python如何查看hdf5文件• python scrapy如何建模• python scrapy处理翻页的方法• python如何重写start_requests方法• python scrapy模拟登录的方法• python scrapy.Request发送请求的方式• python字典的元素访问• python字典如何遍历数据• python pytesseract库是什么

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网