0
点赞
收藏
分享

微信扫一扫

用百度AI识别图片中的文字,精度高

小猪肥 2023-01-07 阅读 105


具体内容参考此文章。

​​https://jingyan.baidu.com/article/4b52d702c7fb86fc5d774b61.html​​


from aip import AipOcr
import re

APP_ID='***'
API_KEY='***'
SECRET_KEY='***'
client=AipOcr(APP_ID,API_KEY,SECRET_KEY)
i=open(r'1.jpg','rb')
img=i.read()
msg=client.basicGeneral(img)
# msg是一个字典,其中words_result中包含了文字信息
for i in msg.get('words_result'):
print(i.get('words'))


举报

相关推荐

0 条评论