classification_5k

generic image classification

Desktop, Classification, Caffe

curl -X PUT http://localhost:8080/services/classification_5k -d
{
 "description": "generic image classification service",
 "model": {
  "repository": "___REPOSITORY___"
 },
 "mllib": "caffe",
 "type": "supervised",
 "parameters": {
  "input": {
   "connector": "image",
   "height": 224,
   "width": 224
  },
  "mllib": {
   "nclasses": 21841,
   "gpu": true,
   "gpuid": 0
  }
 }
}
curl -X POST 'http://localhost:8080/predict' -d '{
  "service": "classification_5k",
  "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 = 'classification_5k'
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": "classification_5k",
  "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": "classification_5k",
    "time": 41
  },
  "body": {
    "predictions": [
      {
        "classes": [
          {
            "prob": 0.06305904686450958,
            "cat": "Library"
          },
          {
            "prob": 0.06247774139046669,
            "cat": "Roof"
          }
        ],
        "uri": "/data/example.jpg"
      }
    ]
  }
}