This repository helps in deploying deep learning based models in the production.
Install Tensorflow, Keras, Flask and Pillow.
$ pip install flask requests pillow
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
.
Requests can be submitted via cURL or web browser.
- Using Curl
$ curl -X POST -F [email protected] '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
}
- Web browser:
Upload image and get the results in json format in the browser.
-
Deploy Your First Deep Learning Model On Kubernetes With Python, Keras, Flask, and Docker
-
To deploy model on AWS just configure Nginx and uWGSI and open port from instance settings.
-
REST-auth, readthedocslatest,token-based-authentication-with-flask