curl -X PUT http://localhost:8080/services/faces -d '{
"description": "face detection service",
"model": {
"repository": "/opt/models/faces",
"create_repository": true,
"init":"https://deepdetect.com/models/init/desktop/images/detection/faces_512.tar.gz"
},
"mllib": "caffe",
"type": "supervised",
"parameters": {
"input": {
"connector": "image"
}
}
}'
curl -X POST 'http://localhost:8080/predict' -d '{
"service": "faces",
"parameters": {
"input": {},
"output": {
"confidence_threshold": 0.4,
"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.4, "bbox": True}
data = ["/data/example.jpg"]
sname = 'faces'
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": "faces",
"parameters": {
"input": {}
"output": {
"confidence_threshold": 0.4,
"bbox": true
},
"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": "faces",
"time": 46
},
"body": {
"predictions": [
{
"classes": [
{
"prob": 0.390458345413208,
"bbox": {
"xmax": 364.34820556640625,
"ymax": 50.02314376831055,
"ymin": 82.06399536132812,
"xmin": 326.3580017089844
},
"cat": "1"
},
{
"prob": 0.3900381922721863,
"bbox": {
"xmax": 271.8947448730469,
"ymax": 47.45260238647461,
"ymin": 74.53034973144531,
"xmin": 239.1929931640625
},
"cat": "1"
},
{
"prob": 0.325770765542984,
"bbox": {
"xmax": 531.6181030273438,
"ymax": 57.574459075927734,
"ymin": 82.18014526367188,
"xmin": 501.7938232421875
},
"cat": "1"
},
{
"prob": 0.23247282207012177,
"bbox": {
"xmax": 230.73373413085938,
"ymax": 16.717960357666016,
"ymin": 38.75651931762695,
"xmin": 201.1503448486328
},
"cat": "1"
},
{
"prob": 0.21733301877975464,
"bbox": {
"xmax": 398.0325927734375,
"ymax": 38.843482971191406,
"ymin": 60.36002731323242,
"xmin": 371.2444152832031
},
"cat": "1"
},
{
"prob": 0.20370665192604065,
"bbox": {
"xmax": 439.99615478515625,
"ymax": 48.639259338378906,
"ymin": 74.54566955566406,
"xmin": 407.150390625
},
"cat": "1"
},
{
"prob": 0.1948963850736618,
"bbox": {
"xmax": 160.39971923828125,
"ymax": 27.83022689819336,
"ymin": 50.85374450683594,
"xmin": 132.84400939941406
},
"cat": "1"
},
{
"prob": 0.18383292853832245,
"bbox": {
"xmax": 536.7980346679688,
"ymax": 1.5278087854385376,
"ymin": 26.120481491088867,
"xmin": 472.716796875
},
"cat": "1"
},
{
"prob": 0.1603844314813614,
"last": true,
"bbox": {
"xmax": 88.8065185546875,
"ymax": 45.23637771606445,
"ymin": 68.2235107421875,
"xmin": 61.595584869384766
},
"cat": "1"
}
],
"uri": "/data/example.jpg"
}
]
}
}