faces_gender

face and gender detection

Desktop, Detection, Caffe

curl -X PUT http://localhost:8080/services/faces_gender -d '{
 "description": "face and gender detection service",
 "model": {
  "repository": "/opt/models/faces_gender",
  "create_repository": true,
  "init":"https://deepdetect.com/models/init/desktop/images/detection/faces_gender.tar.gz"
 },
 "mllib": "caffe",
 "type": "supervised",
 "parameters": {
  "input": {
   "connector": "image"
  }
 }
}'
curl -X POST 'http://localhost:8080/predict' -d '{
  "service": "faces_gender",
  "parameters": {
    "input": {},
    "output": {
      "confidence_threshold": 0.4,
      "bbox": true
    },
    "mllib": {
      "gpu": true
    }
  },
  "data": [
    "/data/example.jpg"
  ]
}'
from dd_client import DD
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_gender'
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_gender",
  "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_gender_v4",
    "time": 379
  },
  "body": {
    "predictions": [
      {
        "classes": [
          {
            "prob": 0.9989920258522034,
            "bbox": {
              "xmax": 188.1786346435547,
              "ymax": 95.33650970458984,
              "ymin": 253.5126190185547,
              "xmin": 25.546676635742188
            },
            "cat": "male"
          },
          {
            "prob": 0.9103379845619202,
            "bbox": {
              "xmax": 398.0808410644531,
              "ymax": 98.45462799072266,
              "ymin": 257.0015869140625,
              "xmin": 227.84500122070312
            },
            "cat": "male"
          },
          {
            "prob": 0.8768270611763,
            "bbox": {
              "xmax": 604.056884765625,
              "ymax": 96.18730926513672,
              "ymin": 257.2901306152344,
              "xmin": 434.84747314453125
            },
            "cat": "male"
          },
          {
            "prob": 0.16960744559764862,
            "last": true,
            "bbox": {
              "xmax": 599.8035888671875,
              "ymax": 92.09048461914062,
              "ymin": 260.4921569824219,
              "xmin": 430.36224365234375
            },
            "cat": "female"
          }
        ],
        "uri": "/data/example.jpg"
      }
    ]
  }
}