您的位置:首页 > 编程语言 > Python开发

使用CloudSight API进行图像识别的Python脚本

2018-03-20 16:28 169 查看
# -*- coding: utf-8 -*-
# @Time    : 2018/03/20 17:02
# @Author  : cxa
# @File    : sss.py
# @Software: PyCharm
import cloudsight
auth = cloudsight.SimpleAuth('apikey')
api = cloudsight.API(auth)
with open('1.png', 'rb') as f:
response = api.image_request(f, '1.png', {
'image_request[locale]': 'en-US',
})
status = api.image_response(response['token'])
print(status)
if status['status'] != cloudsight.STATUS_NOT_COMPLETED:
# Done!
pass
status = api.wait(response['token'], timeout=30)

  

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: