Demos for your ML Models

Generate an easy-to-use demo for your ML model or function with only a few lines of code. Integrate directly into your Python notebook, or share a link with your interdisciplinary team. Click Here to Get Started in just 5 minutes.

Gradio allows you to quickly create customizable UI components around your TensorFlow or PyTorch models, or even arbitrary Python functions. Mix and match components to support any combination of inputs and outputs. Our core library is free and open-source!

Below are a few demos. Check the Getting Started for full code examples.

import gradio as gr

def recognize_digit(img):
    # ... implement digit recognition model on input array 
    # ... return dictionary of labels and confidences 

gr.Interface(fn=recognize_digit, inputs="sketchpad", outputs="label").launch()
The single line of code above produces the web interface below. Draw a number 0 through 9 on the sketchpad below and see predictions in real time!
import gradio as gr

def answer_question(paragraph, question):
    # ... implement Q&A model
    # ... return answer to question

gr.Interface(fn=answer_question, inputs=["textbox", "text"], outputs="text").launch()
Provide a context paragraph and ask a question that can be answered with the context information. Go ahead, type in some information and a question. Then, click submit to get the answer!
import gradio as gr

def face_segmentation(img):
    # ... implement face segmentation model on input 200x200 numpy array
    # ... return segmentation mask as numpy array

webcam = gr.inputs.Image(shape=(200, 200), source="webcam")
gr.Interface(fn=face_segmentation, inputs=webcam, outputs="image").launch()
Take a snapshot from your webcam and click submit to generate a face segmentation.
import gradio as gr, matplotlib.pyplot as plt

def outbreak_forecast(r, month, countries, social_distancing):
    # ... run model to forecast outbreak and generate plots
    # ... return plt

r = gr.inputs.Slider(1, 5)
month = gr.inputs.Dropdown(["May", "June", "July"])
countries = gr.inputs.CheckboxGroup(["USA", "Canada", "Mexico", "UK"])

gr.Interface(fn=outbreak_forecast,
    inputs=[r, month, countries, "checkbox"], outputs="plot").launch()
Provide the parameters below and click submit to view the forecast of a simulated disease outbreak. This is not based on an actual disease and uses synthetic data.
Built to integrate with

Fast, easy setup

Gradio can be installed directly through pip. Creating a Gradio interface only requires adding a couple lines of code to your project. You can choose from a variety of interface types to interface your function.

More on Getting Started >>

Present and share

Gradio can be embedded in Python notebooks or presented as a webpage. A Gradio interface can automatically generate a public link you can share with colleagues that lets them interact with the model on your computer remotely from their own devices.

More on Sharing >>

Permanent hosting

Once you've created an interface, you can point Gradio towards the GitHub repository where it is contained. Gradio will host the interface on its servers and provide you with a link you can share.

More on Hosting >>

Gradio is now an essential part of our ML demos. All it takes is a few minutes to make a demo come to life.
- Mohamed El-Geish, Director of AI at Cisco
Gradio accelerated our efforts to build and demo interdisciplinary models by quickly letting clinicians interact with machine learning models without writing any code. It's a huge time-saver!
- David Ouyang, Cardiologist at Stanford Medicine

Used by machine learning teams at

Dear #MachineLearning twitter,
If you haven't typed:
$ πš™πš’πš™ πš’πš—πšœπšπšŠπš•πš• πšπš›πšŠπšπš’πš˜
yet, now would be a damn good time.
Especially if you are working in computer vision & deploying models in the real world. twitter.com/abidlabs/statu...

πŸš€πŸš€πŸš€ In other news, proud to share what the @GradioML team has been working on for the past few weeks! Just released 1.3.0, which has 3 big updates:

πŸ”Ž 1. INTERPRETATIONS: You can get out-of-the-box interpretations for any regression / classification model in 1 line of code:

Having @GradioML deploy your model is like a test-of-time award, except it’s test-of-now. Open implementation, clear code, and actionable dataset has to skew towards better papers. twitter.com/GradioML/statu...

We took 5 of our favorite #NeurIPS2020 papers and created web demos from their public code using @GradioML. So that anyone can use the models, right from your browser! #accessibility
#reproducibility

The models & links to the web demos are below:

Pretty neat that @GradioML! 🐍πŸ”₯

+ Generate an easy-to-use UI for your #ML model, function, or #API with only a few lines of code!
+ Integrate directly into your @ProjectJupyter notebook
+ or share a link with anyone

h/t @VincentTerrasi
#MachineLearning
www.gradio.app

Check out this cool python library! @GradioML lets you easily create web-based interfaces for your ML models twitter.com/abidlabs/statu...

I recorded a quick tutorial covering all of the core features of the @GradioML Python library πŸ˜€

- creating GUIs to demo ML models
- deploying via share links
- visualizing interpretations
- seeing embeddings

What other features would you like to see?
www.youtube.com/watch?v=O_3FINRtwhs

Contact Us.

Have questions, or want to integrate Gradio in a large team? Get in touch.


Running into any technical issues? Open an issue at our github repo.