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踐行者 的文章