Coder Social home page Coder Social logo

arbori's Introduction

AR bori python image classification backend (a.k.a. Black Box API)

Init/Install project

First clone the repo.

git clone https://${USERNAME}@bitbucket.org/exahexa/ar-bori-model.git

At first, the command make dev will create the docker image (After that you can rebuild with make build)

make run

Makefile commands

# Build the python service image and force remove previous instance
make build

# Push to docker hub
make push

# Run all the service containers with compose (docker-compose up) and force recreate container for python service
make run

# Run developement environment (make run with docker-compose.dev.yml)
make dev

# Get into the python service's container shell
make exec

# Turn down running docker-compose services
make down

Usage

Server will be listening on port 3000

API endpoints:

  • POST /predict

POST /predict

Receives an image and tries to predict its class.

  • request: POST /predict
  • required headers: {Content-Type: application/json}

JSON properties:

{
  "image": "/9j/4ROSR ... FAf/Z"
}
  • image: Base64 encoded image that contains the object.

Response:

{
    "status": "Success", 
    "prediction": {
        "class": "phone", 
        "probability": "0.9996686"
        }, 
    "processing_runtime": "1125.247ms"
}
  • status: Indicates the result of the request.
  • prediction:
    • class: The predicted class of the image.
    • probability: The probability of the image being the instance of that class
  • processing_runtime: The total runtime of transforming and predicting the image's class

Error handling (HTTP 400, HTTP 500)

All internal server errors and bad request has the following JSON response structure sent with the appropriate status code:

{
  "status": "Failed",
  "status_message": " ...Developers explonation... ",
  "error_message": " ...Error from the application... "
}

Postman

Postman collection file: postman_example/arbori.postman_collection.json.

© gaborpelesz 2019

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.