人工智能接口 百度AI

需要安装这个模块

pip install baidu-aip  

导入模块

from aip import AipOcr  

百度AI人工智能,图片识别文字接口

App_ID=" "
API_Key=" "
Secret_Key=" "

接口给对象clinet

clinet=AipOcr(App_ID,API_Key,Secret_Key)

image_path=‘本地文件路径’

with open(image_path,"rb") as f:
	image=f.read()

获取接口 basic General 基本通用 replace 替换、取代 空格替换为非空格
data=clinet.basicGeneral(image).replace(" “,”")

data=clinet.basicGeneral(image)

获取的数据类型为字典

print(data)
Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐