A guide for creating UI and deploying machine learning model with Streamlit vs Gradio


Installing Graido

Import Gradio

Gradio API

  • Fn — the function to wrap, the function will accept the input data.
  • Inputs — input component types which could be an image, textbox, checkbox, etc. You can also provide a list of inputs.
  • Outputs — output component types, it has similar types to the input types.

Run app

Gradio Hosting

Image classification with Gradio

Building an image classification with Gradio
Webpage of image classification built with Gradio


Streamlit principles

  • Building apps iteratively and with few lines of code
  • Adding a widget is the same as declaring a variable
  • Effortlessly share, manage and collaborate on your apps

Install Streamlit

Import Streamlit

Streamlit API

Display Text

Display Data

Display Charts

Display Media

Display Widgets

Image classification with Streamlit

Building an image classification with Streamlit
Webpage of image classification with Streamlit

Run App

Streamlit Hosting

Streamlit vs Gradio



I develop machine learning models and deploy them to production using cloud services.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store