paddlepaddle(python PaddleOCR库的介绍)
导读:说明...
说明
1 、PaddleOCR是基于深度学习的ocr识别库 ,中文识别精度相当还不错 ,能够应对大多数文字提取需求 。
2 、需要依次安装三个依赖库,shapely库可能会受到系统的影响 ,出现安装错误 。
安装命令
pipinstallpaddlepaddle pipinstallshapely pipinstallpaddleocr代码实现
ocr=PaddleOCR(use_angle_cls=True,) #输入待识别图片路径 img_path=r"d:\Desktop\4A34A16F-6B12-4ffc-88C6-FC86E4DF6912.png" #输出结果保存路径 result=ocr.ocr(img_path,cls=True) forlineinresult: print(line) fromPILimportImage image=Image.open(img_path).convert(RGB) boxes=[line[0]forlineinresult] txts=[line[1][0]forlineinresult] scores=[line[1][1]forlineinresult] im_show=draw_ocr(image,boxes,txts,scores) im_show=Image.fromarray(im_show) im_show.show()创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!