All Projects → imfing → keras-flask-deploy-webapp

imfing / keras-flask-deploy-webapp

Licence: GPL-3.0 license
😺 Pretty & simple image classifier app template. Deploy your own trained model or pre-trained model (VGG, ResNet, Densenet) to a web app using Flask in 10 minutes.

Programming Languages

javascript
184084 projects - #8 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
CSS
56736 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to keras-flask-deploy-webapp

Image-Classification
Pre-trained VGG-Net Model for image classification using tensorflow
Stars: ✭ 29 (-97.31%)
Mutual labels:  pre-trained
image-segmentation
Mask R-CNN, FPN, LinkNet, PSPNet and UNet with multiple backbone architectures support readily available
Stars: ✭ 62 (-94.25%)
Mutual labels:  pre-trained
Roberta zh
RoBERTa中文预训练模型: RoBERTa for Chinese
Stars: ✭ 1,953 (+81.17%)
Mutual labels:  pre-trained
Paddlehub
Awesome pre-trained models toolkit based on PaddlePaddle.(300+ models including Image, Text, Audio and Video with Easy Inference & Serving deployment)
Stars: ✭ 7,284 (+575.7%)
Mutual labels:  pre-trained
Albert zh
A LITE BERT FOR SELF-SUPERVISED LEARNING OF LANGUAGE REPRESENTATIONS, 海量中文预训练ALBERT模型
Stars: ✭ 3,500 (+224.68%)
Mutual labels:  pre-trained
Segmentation models
Segmentation models with pretrained backbones. Keras and TensorFlow Keras.
Stars: ✭ 3,575 (+231.63%)
Mutual labels:  pre-trained
ModelZoo.pytorch
Hands on Imagenet training. Unofficial ModelZoo project on Pytorch. MobileNetV3 Top1 75.64🌟 GhostNet1.3x 75.78🌟
Stars: ✭ 42 (-96.1%)
Mutual labels:  pre-trained
vgg16 batchnorm
VGG16 architecture with BatchNorm
Stars: ✭ 14 (-98.7%)
Mutual labels:  pre-trained

Deploy Keras Model with Flask as Web App in 10 Minutes

GPLv3 license Contributions Welcome

A pretty and customizable web app to deploy your DL model with ease

Buy Me A Coffee

Getting Started in 10 Minutes

👇 Screenshot:

New Features 🔥

  • Enhanced, mobile-friendly UI
  • Support image drag-and-drop
  • Use vanilla JavaScript, HTML and CSS. Remove jQuery and Bootstrap
  • Switch to TensorFlow 2.0 and tf.keras by default
  • Upgrade Docker base image to Python 3 (it's 2020)

If you need to use Python 2.x or TensorFlow 1.x, check out the legacy snapshot


Run with Docker

With Docker, you can quickly build and run the entire application in minutes 🐳

# 1. First, clone the repo
$ git clone https://github.com/mtobeiyf/keras-flask-deploy-webapp.git
$ cd keras-flask-deploy-webapp

# 2. Build Docker image
$ docker build -t keras_flask_app .

# 3. Run!
$ docker run -it --rm -p 5000:5000 keras_flask_app

Open http://localhost:5000 and wait till the webpage is loaded.

Local Installation

It's easy to install and run it on your computer.

# 1. First, clone the repo
$ git clone https://github.com/mtobeiyf/keras-flask-deploy-webapp.git
$ cd keras-flask-deploy-webapp

# 2. Install Python packages
$ pip install -r requirements.txt

# 3. Run!
$ python app.py

Open http://localhost:5000 and have fun. 😃


Customization

It's also easy to customize and include your models in this app.

Details

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.

Details

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;
  }
}

Future Plan

  • Support detection and segmentation models

More Resources

Building a simple Keras + deep learning REST API

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].