Gradio
Put a beautiful interactive demo layer over your trained ML model.
Getting started
Gradio (gradient input-output) is a python library that allows you to easily transform your trained model into a webpage that easily allows you to interface with it. This allows you to:
- Show off the model to others
- Identify response to unusual behavior
- Encourage fairness and reproducibility of your model
Installation
Gradio is a standard python library, so install it from your terminal like this:
pip install gradio
Usage
To use gradio in your code, simply import it, and then launch the appropriate interface
import gradio
import tensorflow as tf
model = tf.keras.Sequential()
# Define your model, as you ordinarily do
# Train your model, as you ordinarily do
gradio.interfaces.Sketchpad(model=model, model_type='keras').launch()
Currently, the following
model_type
are supported:
- Keras models
- Sklearn models
- Arbitrary python functions
Gallery of Interfaces
Draw a Digit: allow users to draw their own digits to test MNIST-type models.
Emotion Detector: allow users to make emotions through their webcam and detect their emotion with your model.
Automated Author: use an RNN to generate a sequence of words beginning the words that the user has supplied