Giter Club home page Giter Club logo

keras-rest-api's Introduction

Keras REST API with Flask RESTPlus, Swagger, Gunicorn and Docker

This project is a simple boilerplate for deploying Keras models with Flask RESTPlus, Swagger, Gunicorn and Docker.

Prerequisites

  • Docker

Installing

  1. Clone this repository in your local system and navigate to root folder.
$ git clone repository-url
  1. Navigate to docker folder and run.
$ cd docker
$ docker-compose up

Run

This will expose on http://127.0.0.1:5000 the Swagger API docs and that's all!

Usage

When the project is fully deployed, you will get a single endpoint. This endpoint will allow to predict house prices by using a simple Keras Boston house pricing regression model loaded from a HDF5 file.

House pricing

This endpoint will predict a house price by using the following input data.

You must provide all these parameters as float numbers:

  • crim: Per capita crime rate by town.
  • zn: Proportion of residential land zoned for lots over 25,000 sq.ft.
  • indus: Proportion of non-retail business acres per town.
  • chas: Charles River dummy variable (= 1 if tract bounds river; 0 otherwise).
  • nox: Nitric oxides concentration (parts per 10 million).'
  • rm: Average number of rooms per dwelling.
  • age: Proportion of owner-occupied units built prior to 1940.
  • dis: Weighted distances to five Boston employment centres.
  • rad: Index of accessibility to radial highways.
  • tax: Full-value property-tax rate per $10,000.
  • ptratio: Pupil-teacher ratio by town.
  • b: 1000(Bk - 0.63)^2 where Bk is the proportion of blacks by town.
  • lstat: Percentage of lower status of the population.

The endpoint will return the predicted value as a median value of owner-occupied homes in one thousand dollars.

The response with default input data:

{
    "medv": 453.8800964355469, 
    "description": "Median value of owner-occupied homes in $1000's.", 
}

Built With

  • Flask - Web framework
  • Flask-RESTPlus - Flask REST Extensions
  • Swagger - API Documentation
  • Keras - Deep learning framework
  • Gunicorn - Python WSGI HTTP Server for UNIX
  • Docker - Platform as a Service (PaaS) to deliver software in containers

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Víctor Vives - Main developer - vvives

See also the list of contributors who participated in this project.

License

Project License

This project is licensed under the MIT License - see the LICENSE.md file for details

keras-rest-api's People

Watchers

 avatar

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.