generic object detection
Embedded, Detection, Caffe
curl -X PUT http://localhost:8080/services/generic_detect_v2 -d '{
"description": "generic object detection service",
"model": {
"repository": "/opt/models/generic_detect_v2",
"create_repository": true,
"init":"https://deepdetect.com/models/init/embedded/images/detection/squeezenet_ssd_generic_detect_v2.tar.gz"
},
"mllib": "caffe",
"type": "supervised",
"parameters": {
"input": {
"connector": "image"
}
}
}'
curl -X POST 'http://localhost:8080/predict' -d '{
"service": "generic_detect_v2",
"parameters": {
"input": {},
"output": {
"confidence_threshold": 0.5,
"bbox": true
},
"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 = {}
parameters_mllib = {}
parameters_output = {"confidence_threshold":0.5,"bbox":True}
data = ["/data/example.jpg"]
sname = 'generic_detect_v2'
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": "generic_detect_v2",
"parameters": {
"input": {},
"output": {
"confidence_threshold": 0.5,
"bbox": true
},
"mllib": {
"gpu": true
}
},
"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": "generic_detect_v2",
"time": 50
},
"body": {
"predictions": [
{
"classes": [
{
"prob": 0.7916921973228455,
"bbox": {
"xmax": 494.16363525390625,
"ymax": 24.178077697753906,
"ymin": 411.2965087890625,
"xmin": 97.42479705810547
},
"cat": "1"
},
{
"prob": 0.6092143058776855,
"bbox": {
"xmax": 411.5879211425781,
"ymax": 83.2486801147461,
"ymin": 146.58810424804688,
"xmin": 306.9629211425781
},
"cat": "1"
},
{
"prob": 0.5768523812294006,
"bbox": {
"xmax": 295.932861328125,
"ymax": 227.992919921875,
"ymin": 380.48736572265625,
"xmin": 162.4053192138672
},
"cat": "1"
},
{
"prob": 0.57443767786026,
"last": true,
"bbox": {
"xmax": 621.4046020507812,
"ymax": 170.29580688476562,
"ymin": 416.793212890625,
"xmin": 477.0945129394531
},
"cat": "1"
}
],
"uri": "/data/example.jpg"
}
]
}
}