curl -X PUT http://localhost:8080/services/words_mnist -d '{
"description": "OCR service",
"model": {
"repository": "/opt/models/words_mnist",
"create_repository": true,
"init":"https://deepdetect.com/models/init/desktop/images/ocr/words_mnist.tar.gz"
},
"mllib": "caffe",
"type": "supervised",
"parameters": {
"input": {
"connector": "image"
}
}
}'
curl -X POST 'http://localhost:8080/predict' -d '{
"service": "words_mnist",
"parameters": {
"input": {},
"output": {
"confidence_threshold": 0,
"ctc": true,
"blank_label": 0
},
"mllib": {
"gpu": true
}
},
"data": [
"/data/example.jpg"
]
}'
from dd_client import DD
host = 'localhost'
port = 8080
dd = DD(host,port)
dd.set_return_format(dd.RETURN_PYTHON)
parameters_input = {"confidence_threshold":0, "ctc":True, "blank_label": 0}
parameters_mllib = {}
parameters_output = {}
data = ["/data/example.jpg"]
sname = 'words_mnist'
classif = dd.post_predict(sname,data,parameters_input,parameters_mllib,parameters_output)
// https://www.npmjs.com/package/deepdetect-js
var DD = require('deepdetect-js');
const dd = new DD({
host: 'localhost',
port: 8080
})
const postData = {
"service": "words_mnist",
"parameters": {
"input": {
"confidence_threshold": 0,
"ctc": true,
"blank_label": 0
},
"output": {},
"mllib": {}
},
"data": [
"/data/example.jpg"
]
}
async function run() {
const predict = await dd.postPredict(postData);
console.log(predict);
}
run()
{
"status": {
"code": 200,
"msg": "OK"
},
"head": {
"method": "/predict",
"service": "words_mnist",
"time": 17
},
"body": {
"predictions": [
{
"classes": [
{
"prob": 1,
"last": true,
"cat": "believed"
}
],
"uri": "/data/example.jpg"
}
]
}
}