文字识别接口用不了了
182******34 发布于2020-07 浏览:1096 回复:3
0
收藏

用的最新版baidu-aip为什么会这样呢?

收藏
点赞
0
个赞
共3条回复 最后由用户已被禁言回复于2022-04
#4182******34回复于2020-07

python 版本3.8.3

0
#3182******34回复于2020-07

client = AipOcr(APP_ID, API_KEY, SECRET_KEY)
filetest = 'Q.jpg'
def get_file_content(filePath):
with open(filePath,'rb') as fp:
return fp.read()

image = get_file_content(filetest)

r = client.tableRecognitionAsync(image);

requestId =r['result'][0]['request_id']
options = {}
options["result_type"] = 'json'

rs = client.getTableRecognitionResult(requestId,options);

print(requestId)
print(resu)
print(rs)

0
#2用户已被禁言回复于2020-07

代码贴一下。Python版本也说明一下。

 

1
TOP
切换版块