MAX是模型资产交换 Model Asset Exchange(https://developer.ibm.com/code/exchanges/models/)。
提供了一站式交流平台,开发人员可在此查找和使用免费的开源深度学习模型,它提供使得经过良好测试的机器学习与深度学习模型供大家免费使用。
简单来说就是提供了一个可以免费获取预训练模型的网站。
依赖:
安装docker
系统要求,最小2GB Memory 以及2 CPUs.
使用步骤:
1. 构建模型
如下脚本:
$ git clone https://github.com/IBM/MAX-Image-Caption-Generator.git
$ cd MAX-Image-Caption-Generator
$ docker build -t max-image-caption-generator .
2. 部署模型
运行:
$ docker run -it -p 5000:5000 max-image-caption-generator
3. 使用模型
样例:
$ curl -F "image=@assets/surfing.jpg" -X POST http://localhost:5000/model/predict
{
"status": "ok",
"predictions": [
{
"index": "0",
"caption": "a man riding a wave on top of a surfboard .",
"probability": 0.038827644239537
},
{
"index": "1",
"caption": "a person riding a surf board on a wave",
"probability": 0.017933410519265
},
{
"index": "2",
"caption": "a man riding a wave on a surfboard in the ocean .",
"probability": 0.0056628732021868
}
]
}
4. 开发调试
为了调试编辑config.py把DEBUG = True。
閱讀更多 AI踐行者 的文章