GitHub - mtobeiyf/keras-flask-deploy-webapp: Pretty&simple image classifier...
source link: https://github.com/mtobeiyf/keras-flask-deploy-webapp
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
Deploy Keras Model with Flask as Web App in 10 Minutes
A pretty and customizable web app to deploy your DL model with ease
Getting started in 10 minutes
- Clone this repo
- Install requirements
- Run the script
- Check http://localhost:5000
- Done! ?
?Screenshot:
Installation
Clone the repo
$ git clone https://github.com/mtobeiyf/keras-flask-deploy-webapp.git
Install requirements
$ pip install -r requirements.txt
Make sure you have the following installed:
- tensorflow
- keras
- flask
- pillow
- h5py
- gevent
Run with Python
Python 2.7 or 3.5+ are supported and tested.
$ python app.py
Play
Open http://localhost:5000 and have fun. ?
Customization
Use your own model
Place your trained .h5
file saved by model.save()
under models directory.
Check the commented code in app.py.
Use other pre-trained model
See Keras applications for more available models such as DenseNet, MobilNet, NASNet, etc.
Check this section in app.py.
UI Modification
Modify files in templates
and static
directory.
index.html
for the UI and main.js
for all the behaviors
Deployment
To deploy it for public use, you need to have a public linux server.
Run the app
Run the script and hide it in background with tmux
or screen
.
$ python app.py
You can also use gunicorn instead of gevent
$ gunicorn -b 127.0.0.1:5000 app:app
More deployment options, check here
Set up Nginx
To redirect the traffic to your local app.
Configure your Nginx .conf
file.
server {
listen 80;
client_max_body_size 20M;
location / {
proxy_pass http://127.0.0.1:5000;
}
}
More resources
Check Siraj's "How to Deploy a Keras Model to Production" video. The corresponding repo.
Recommend
-
74
readme.md Emojinator This code helps you to recognize and classify different emojis. As of now, we are only supporting hand emojis. Code Requirements You can install Conda for p...
-
49
README.md Breast density classification with deep convolutional neural networks Introduction This is an implementation of the model used for breast density classification as described...
-
44
Spoiler — No bullshit, to the point Dhrumil Patel
-
36
When I first started learning Machine Learning and deep learning, It took me forever to learn how to build an image classifier, I took all machine lear...
-
29
A simple Java WebApp with REST. Contribute to eitch/simple-webapp development by creating an account on GitHub.
-
37
A simple Java WebApp with REST. Contribute to eitch/simple-webapp development by creating an account on GitHub.
-
32
Deploy your Angular application in a Java artifact For new projects I suggest that you separate your Angular application from your backend artifact (.war, .jar or different). If for some reasons (legacy, architecture etc.) y...
-
5
Pretty-print syntax trees with this one simple trick prettyprintI want to share a simple trick for pretty-printing syntax trees with the correct precedence that I’ve been using in my own interpreter projects. I believe this...
-
21
In this post, I’m going to configure the continuous delivery process for Azure WebApp (Azure Function in this case, but that’s pretty much the same) with Octopus Deploy. To make it a little bit interesting I’m going to use Configuration-as-Co...
-
4
How to deploy a Java and React webapp in one JAR/WAR ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK