I've created a web page that makes it easy to process images using Streamlit
and Heroku
, so I'll leave that introduction.
Work log: Create an image processing app with streamlit. :: tomowarkar's tech blog — go 3 steps and go 2 steps
pip install streamlit
streamlit run https://github.com/tomowarkar/stapp/blob/master/app.py
Streamlit — The fastest way to build custom ML tools
Streamlit's open source app framework is the easiest way for data scientists and machine learning engineers to create beautiful, high-performance apps in hours. Everything in pure Python. It's all free. Streamlit — The fastest way to build custom ML tools (Google Japanese translation)
--Deploy a web app made with Streamlit on Heroku.
-Heroku account and Heroku CLI need to be prepared
--The library is managed using pipennv
, but of course you can use requirements.txt
.
$ mkdir stapp
$ cd stapp
$ pipenv install --python 3
$ pipenv install streamlit
$ mkdir stapp
$ cd stapp
$ pip insatll streamlit
$ echo streamlit==0.60.0 >requirements.txt
$ touch app.py
app.py
import streamlit as st
st.title("Hello Streamlit!!")
st.subheader("This is calculator.")
a = st.slider("a: ", 0, 10, 5, 1)
b = st.slider("b: ", 0, 10, 5, 1)
st.write(f"{a} x {b} = {a*b}")
That's it
$ echo "web: streamlit run --server.enableCORS false --server.port \$PORT app.py" >Procfile
$ git init
$ git add .
$ git commit -m "first commit"
$ heroku create
$ git push heroku master
$ heroku open
Was the website displayed safely?
Next step
Tutorial: Create a data explorer app — Streamlit 0.61.0 documentation
Streamlit's official tutorial is just right and interesting!
What did you think. You can publish your web app in less than 10 minutes at the earliest.
Although streamlit is not very customizable, you can easily create a web application with a table created with DataFrame
of pandas
, a graph plotted with matplotlib
, and the result of image processing with ʻOpenCV` in just a few lines. You can drop it.
It is very nice that it is completed only with python and you can easily output the deliverables.
Recommended Posts