places

places classification service

Desktop, Classification, Caffe

curl -X PUT http://localhost:8080/services/places -d '{
 "description": "places classification service",
 "model": {
    "repository": "/opt/models/places",
    "create_repository": true,
    "init":"https://deepdetect.com/models/init/desktop/images/classification/places.tar.gz"
 },
 "mllib": "caffe",
 "type": "supervised",
 "parameters": {
  "input": {
   "connector": "image"
  }
 }
}'
curl -X POST 'http://localhost:8080/predict' -d '{
  "service": "places",
  "parameters": {
    "input": {},
    "output": {
      "confidence_threshold": 0.5,
      "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.5,"bbox":True}
data = ["/data/example.jpg"]
sname = 'places'
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": "places",
  "parameters": {
    "input": {},
    "output": {
      "confidence_threshold": 0.5,
      "bbox": true
    },
    "mllib": {
      "gpu": true
    }
  },
  "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": "places",
    "time": 56
  },
  "body": {
    "predictions": [
      {
        "classes": [
          {
            "prob": 0.559813380241394,
            "cat": "downtown"
          },
          {
            "prob": 0.21302251517772675,
            "cat": "skyscraper"
          },
          {
            "prob": 0.04305418208241463,
            "cat": "office_building"
          },
          {
            "prob": 0.030694598332047462,
            "last": true,
            "cat": "plaza"
          }
        ],
        "uri": "/opt/platform/data/alx/deepdetect.com/places.jpg"
      }
    ]
  }
}