用的最新版baidu-aip为什么会这样呢?
python 版本3.8.3
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)
代码贴一下。Python版本也说明一下。
python 版本3.8.3
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)
代码贴一下。Python版本也说明一下。