face emotion detection
Desktop, Detection, Caffe
curl -X PUT http://localhost:8080/services/faces_emo -d '{
"description": "face emotion detection service",
"model": {
"repository": "/opt/models/faces_emo",
"create_repository": true,
"init":"https://deepdetect.com/models/init/desktop/images/detection/faces_emo.tar.gz"
},
"mllib": "caffe",
"type": "supervised",
"parameters": {
"input": {
"connector": "image"
}
}
}'
curl -X POST 'http://localhost:8080/predict' -d '{
"service": "faces_emo",
"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_emo'
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_emo",
"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_emo",
"time": 33
},
"body": {
"predictions": [
{
"classes": [
{
"prob": 0.851776659488678,
"bbox": {
"xmax": 322.82733154296875,
"ymax": 40.19896697998047,
"ymin": 132.21400451660156,
"xmin": 236.5441436767578
},
"cat": "neutral"
},
{
"prob": 0.8290548920631409,
"bbox": {
"xmax": 146.94943237304688,
"ymax": 35.533573150634766,
"ymin": 132.1978302001953,
"xmin": 59.38333511352539
},
"cat": "neutral"
},
{
"prob": 0.7160714268684387,
"last": true,
"bbox": {
"xmax": 321.46368408203125,
"ymax": 294.2980651855469,
"ymin": 390.796875,
"xmin": 235.3292694091797
},
"cat": "neutral"
}
],
"uri": "/data/example.jpg"
}
]
}
}