python图像识别植物识别
错误代码:{'error_code': 110, 'error_msg': 'Access token invalid or no longer valid'}
有Access token生成,但是后面一直是错误。。。。
code:
# encoding:utf-8
import requests
import base64
'''
植物识别
'''
# client_id 为官网获取的AK, client_secret 为官网获取的SK
host = 'https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={API Key}={Secret Key}'
response = requests.get(host)
mytoken = response.json()
print(mytoken)
request_url = "https://aip.baidubce.com/rest/2.0/image-classify/v1/plant"
# 二进制方式打开图片文件
f = open("", "rb")
img = base64.b64encode(f.read())
params = {"image":img}
access_token = "mytoken"
request_url = request_url + "?access_token=" + access_token
headers = {'content-type': 'application/x-www-form-urlencoded'}
response = requests.post(request_url, data=params, headers=headers)
if response:
print (response.json())
相关知识
Python实现识别花卉种类的示例代码
Python识别花卉种类,并自动整理分类!
Python 识别花卉种类,并自动整理分类!
深度学习花卉识别:Python数据集解析
植物识别接口 花卉识别 植物花卉识别 图像识别
基于python编程的五种鲜花识别
20行Python代码开发植物识别 app
图像识别算法有哪些
【花卉识别系统】Python+卷积神经网络算法+人工智能+深度学习+图像识别+算法模型
0020期python训练鲜花识别
原文链接: python图像识别植物识别 https://www.huajiangbk.com/newsview411577.html
| 上一篇: 原生仙客来品种 | 下一篇: 仙客来有几种颜色 |
推荐分享

- 1明日花キララ:明日花绮罗年度... 25234
- 2明日花キララ(明日花绮罗)经... 14859
- 3家庭养花知识大全 家庭养花有... 10240
- 4家庭养花风水知识 家庭养花“... 9945
- 5五月天婷婷开心六月丁香:音乐... 8950
- 6兰花叶子扭的是什么兰 8938
- 7君子兰什么品种最名贵 十大名... 8449
- 8秋天养花,掌握这5点养花知识... 8419
- 9【花卉知识 】养花须知:新手... 8022
- 10十大致癌花卉排行榜,哪些花卉... 8017




