vgg16

generic image classification

Desktop, Classification, Caffe

curl -X PUT http://localhost:8080/services/vgg16 -d
{
 "description": "generic image classification service",
 "model": {
  "repository": "/opt",
  "init":"https://deepdetect.com/models/init/desktop/images/classification/vgg16.tar.gz",
  "create_repository": true,
 },
 "mllib": "caffe",
 "type": "supervised",
 "parameters": {
  "input": {
   "connector": "image"
  }
 }
}
curl -X POST 'http://localhost:8080/predict' -d '{
  "service": "vgg16",
  "parameters": {
    "input": {},
    "output": {
      "confidence_threshold": 0.4,
      "best": 3
    },
    "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, "best": 3}
data = ["/data/example.jpg"]
sname = 'vgg16'
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": "vgg16",
  "parameters": {
    "input": {},
    "output": {
      "confidence_threshold": 0.4,
      "best": 3
    },
    "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": "vgg16",
    "time": 41
  },
  "body": {
    "predictions": [
      {
        "classes": [
          {
            "prob": 0.073883056640625,
            "cat": "Atrium"
          },
          {
            "prob": 0.06305904686450958,
            "cat": "Library"
          },
          {
            "prob": 0.06247774139046669,
            "cat": "Roof"
          },
          {
            "prob": 0.03711871802806854,
            "cat": "Proton accelerator"
          }
        ],
        "uri": "/data/example.jpg"
      }
    ]
  }
}