赞
踩
只要注册了百度账号就可以轻松体验百度智能云中图像识别功能的魅力!
from aip import AipImageClassify """ 你的 APPID AK SK """ APP_ID = '你的ID' API_KEY = '你的key' SECRET_KEY = '你的secret_key' AipImageClassify = AipImageClassify(APP_ID, API_KEY, SECRET_KEY) """ 读取图片 """ def get_file_content(filePath): with open(filePath, 'rb') as fp: return fp.read() image = get_file_content('ppy.jpg') """ 如果有可选参数 """ options = {} options["top_num"] = 3 options["filter_threshold"] = "0.7" options["baike_num"] = 5 """ 调用菜品识别 """ AipImageClassify.dishDetect(image,options) """ 带参数调用菜品识别 """ result = AipImageClassify.dishDetect(image,options) print(result) print(result["result"][0]["name"])
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。