新卡米api的python sdk
neokami-sdk的Python项目详细描述
安装
通过PIP:
pip install neokami-sdk
在python项目中
importneokami
用法
下面是一个简单的图像性别和年龄检测用法示例:
importosimportneokamireq=neokami.ImageAnalyser()directory=os.path.dirname(os.path.abspath(__file__))req.setFile(directory+'/data/team1.jpg')req.setType('gender')req.setApiKey('your api key here')req.setWait(1)analysis=req.analyse()#get the resultsresults=analysis.result()
为了语法简洁,还支持链式函数调用:
importosimportneokamidirectory=os.path.dirname(os.path.abspath(__file__))analysis=neokami.ImageAnalyser().setApiKey(NeokamiTestCredentials.api_key).setFile(directory+'/data/team1.jpg').setType('gender').analyse()
有关如何使用sdk的详细信息,请查看:
测试
要运行测试,需要pytest包:
pip install -U pytest # or easy_install -U pytest
在基于tests/文件夹的 在neokmitestcredentials.python.replace中的模板上输入 你的api密钥。
存储库贡献者可以申请在单元内使用的api密钥 在team@neokami.com进行测试。
可以通过运行以下命令执行测试:
py.test
贡献
很快就来。
发布历史记录
0.2
- 在头上发送api密钥。
- 增加视觉皮层。
- 添加情绪分析。
0.1.1
- 基本URL的https连接。
0.1
- 出生。