Interfaces for your ML Models
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()
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()
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.in.Webcam(shape=(200, 200)) gr.Interface(fn=face_segmentation, inputs=webcam, outputs="image").launch()
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.in.Slider(1, 5) month = gr.in.Dropdown(["May", "June", "July"]) countries = gr.in.CheckboxGroup(["USA", "Canada", "Mexico", "UK"]) gr.Interface(fn=outbreak_forecast, inputs=[r, month, countries, "checkbox"], outputs="plot").launch()
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 >>
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 >>
Pro Tip:— Ramsri Goutham Golla (@ramsri_goutham) January 27, 2021
You built a nice ML model in Colab and want to show it to your Product manager?
With @GradioML you can create an easy GUI for your ML model.
Share the GUI via a simple link (eg:https://t.co/UUb9rDpYRj) to your non-tech manager.#NLProc #MachineLearning #DataScience pic.twitter.com/r7i6n2Vmff
Dear #MachineLearning twitter,— Vinay Prabhu (@vinayprabhu) November 5, 2020
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. https://t.co/ND4WKaOF8u
Pretty neat that @GradioML! 🐍🔥— Charly Wargnier (@DataChaz) January 18, 2021
+ 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 https://t.co/8Gpar1B8vf
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. https://t.co/aBDu3Qh1Mg— David Ouyang, MD (@David_Ouyang) December 15, 2020
After more than 8 years of using python, finally, I had the chance to give back to the community during the #PyConID2020 event. I shared a message for my fellow data scientists in the lightning talk session and why they should check out @GradioML: https://t.co/iSbODtFLbH— Yosef Ardhito (@yoseflaw) November 16, 2020
One again, 5 lines of Python code + amazing @GradioML— Vinay Prabhu (@vinayprabhu) October 9, 2020
results in a more nuanced understanding on the brittleness of a real-world deployed ML model.
Colab or didn't happen? Here: https://t.co/acTCmHyMQ5 pic.twitter.com/9olqMQlSc3
Just create a web UI for Drug-Target Interaction Prediction with less than 10 lines using DeepPurpose and @GradioML 👇 Very impressed with Gradio's simplicity! https://t.co/Xxv574YEGo pic.twitter.com/ghR01lHtUK— Kexin Huang (@KexinHuang5) July 20, 2020
This looks really cool! @GradioML gives you a really easy way to build a simple interface on top of machine learning models. Looking forward to having a play with it and maybe using it in my live streams.— Matt Hamilton (@HammerToe) July 17, 2020
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.