Skip to content

bhavesh907/Model-deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deploy Deep learning models as a REST API

This repository helps in deploying deep learning based models in the production.

Getting started

Install Tensorflow, Keras, Flask and Pillow.

$ pip install flask requests pillow

Starting the Keras server

The Flask + Keras server can be started by running:

$ python mainapp.py 
Using TensorFlow backend.
 * Loading Keras model and Flask starting server...please wait until server has fully started
...
 * Running on http://127.0.0.1:5000

You can now access the REST API via http://127.0.0.1:5000.

Submitting requests to the Keras server

Requests can be submitted via cURL or web browser.

  1. Using Curl
$ curl -X POST -F image=@dog.jpg 'http://localhost:5000/predict'
{
  "predictions": [
    {
      "label": "beagle", 
      "probability": 0.9901360869407654
    }, 
    {
      "label": "Walker_hound", 
      "probability": 0.002396771451458335
    }, 
    {
      "label": "pot", 
      "probability": 0.0013951235450804234
    }, 
    {
      "label": "Brittany_spaniel", 
      "probability": 0.001283277408219874
    }, 
    {
      "label": "bluetick", 
      "probability": 0.0010894243605434895
    }
  ], 
  "success": true
}
  1. Web browser:
Upload image and get the results in json format in the browser. 

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages