Prediction APIs
Enterprise
Applicable to Enterprise tier only
Endpoint Format
參照 Seldon 文件.
API 格式為 http(s)://${primehub_domain}/deployment/${deployment_id}/api/v1.0/predictions
.
Payload Message Format
參照 Github L588-L639 行代碼。
ndarray
請求格式
curl -X POST http(s)://${endpoint} \
-H 'Content-Type: application/json' \
-d '{ "data": {"ndarray": [[5.964,4.006,2.081,1.031]]} }'
等同代碼
X = np.array([[5.964,4.006,2.081,1.031]])
tensor
請求格式
curl -X POST http(s)://${endpoint} \
-H 'Content-Type: application/json' \
-d '{ "data": {"tensor": {"shape":[1,4],"values":[5.964,4.006,2.081,1.031]}} }'
等同代碼
X = np.array([5.964,4.006,2.081,1.031]).reshape([1,4])
strData
請求格式
curl -X POST http(s)://${endpoint} \
-H 'Content-Type: application/json' \
-d '{ "strData": "any string" }'
等同代碼
X = "any string"
binData
請求格式
curl -X POST http(s)://${endpoint} \
-F 'binData=@your_image.jpg'
等同代碼
X = bytes(<content of your_image.jpg>)
參照 範例代碼 在 predict
function 中如何處理 binData
。