Author(s): Shubham Saboo
An elegant and efficient framework to build and share data apps within minutes.
Before starting let's get the fact straight — Every Data Scientist isn’t a good frontend engineer. But in the world where “seeing is believing”, the aesthetics of your project is as important as the technology behind it. What can you do in the situation when you have an amazing data app, but no frontend expertise to present it to a larger audience.
Streamlit to the rescue!
Streamlit is an open-source python library capable of turning data scripts into sharable web applications within minutes. It makes it very easy to build custom web applications with minimal efforts and zero knowledge of front-end design frameworks (all in python). It is a great way to create simple yet elegant interactive user interfaces for your data projects.
Streamlit wraps the cool Machine Learning model into a shiny package in order to present it to a larger audience as an app.
Streamlit is available as a standard python library at PyPI, which can be easily installed using either pip or conda depending on the python environment. Following are the commands for installing Streamlit:
To check if Streamlit is installed correctly, run this simple command in your terminal:
Why makes Streamlit unique?
The idea behind streamlit is to make data app creation as easy as writing a python script.
Within very little time, it has created a flourishing community of ML engineers and data scientists from around the world, which keeps the discussion forum lively and updated so you don't have to waste hours and hours debugging issues or adding a new feature to your application. The other key features of streamlit are as follows:
- Embrace Python Scripting: Streamlit applications are really just scripts that run from top to bottom. There’s no hidden state and you can factor your code with function calls. If you know how to write Python scripts, you are all set for creating cool Streamlit apps. Let's look at an example in action:
- Interaction comes in handy: Streamlit treats a widget as a variable, so adding a widget is as simple as declaring a variable. There is no need to write a backend code, define routes, handle HTTP requests, etc. Every interaction simply reruns the script from top to bottom. This approach leads to a really clean code:
- Instant Deployment: Streamlit also provides a platform to effortlessly share your app over the web to a larger audience. It provides simple GitHub integration which allows you to deploy the code directly from your GitHub repository with minimal effort.
Some Really Cool Examples
Streamlit as a community believes in open-source, so most of the projects created by the members are made open-source. Now we will go through some really cool projects which are created with Streamlit:
- Real-Time Object Detection System: This application is built by using Udacity’s Self Driving Car dataset. It is capable of detecting objects in real-time, it uses YOLO object detection algorithm in the backend interweaved with Streamlit in the frontend.
- Face GAN Explorer: This application is capable of generating photorealistic faces and is built on top of TensorFlow using Nvidia’s Progressive Growing of GANs and Shaobo Guan’s Transparent Latent-space GAN method for tuning the output face’s characteristics.
- Geographic Data Browser for NYC: This application uses Uber pickup data of New York City to interactively visualize uber pickups and passenger's journey across NYC.
Streamlit is becoming a de-facto choice for data scientists and ML engineers these days to quickly build and share proofs-of-concept with a larger audience in an aesthetically pleasing and interactive environment rather than being stuck in the web of two-dimensional Jupiter notebook environment. Streamlit is user-friendly and can be learned with zero to minimal effort by someone already familiar with python scripting.
Also +1 for the great documentation prepared by the Streamlit team!
If you would like to learn more or want to me write more on this subject, feel free to reach out…
If you liked this post or found it helpful, please take a minute to press the clap button, it increases the post visibility for other medium users.
Published via Towards AI