Join us
@neji_14 ă» Jun 02,2022 ă» 1 min read ă» 18429 views
Streamlit is an open source app framework in Python language. It helps in creating web apps for data science and machine learning in a short time and is compatible with major Python libraries such as scikit-learn, Keras, PyTorch, SymPy(latex), NumPy, pandas, Matplotlib etc.
Streamlit is an open source app framework in Python language. It helps in creating web apps for data science and machine learning in a short time and is compatible with major Python libraries such as scikit-learn, Keras, PyTorch, SymPy(latex), NumPy, pandas, Matplotlib etc.
So I was working on a project with the ResNet50 image classification model in Google colab and I wanted to create a Streamlit app.
I didnât want to download the files directly to my physical machine just so I could make the app so I searched for ways on how to do it directly from Google colab and hereâs how to do it:
1. Install Streamlit in your instance of Google colab by running:
2. Sign up for a ngrok account: http://ngrok.com
3. After signing up hit the sidebar and youâd see something like this in the picture.
Click on âYour Authtokenâ then copy your token.
4. Then run this in Google colab:
Replace your_token with your copied token.
5. Run this next to install the pyngrok package:
6. Run this next:
7. You can now proceed and create a .py file with the contents of your streamlit app.
To create the .py file run this in the next cell:
In the same cell as the command above you can write all the contents of the app and then when that cell is run the streamlit_app.py file is created in your Google colab instance.
After all that you can now run the app from Google colab by running this command in another cell:
And the app should be up and running like in the image below.
Advantages of Creating a Streamlit App through Google colab
If you want to check out what I was working on the project link and GitHub links are provided below:
App Link : https://share.streamlit.io/nneji123/deep-learning-object-recognition-with-resnet50/main
GitHub Repository: Nneji123/Deep-Learning-Object-Recognition-with-ResNet50
Join other developers and claim your FAUN account now!
Junior Data Scientist, Zummit Africa
@neji_14Influence
Total Hits
Posts
Only registered users can post comments. Please, login or signup.
@neji_14 :Thanks so mcuh for the fantastic post .
A quick question though - How to we make sure the colab session does not terminate ? If the colab session terminates , the steamlit app hosted through colab is no longer up and serving requests ! Your response would be much appreciated !!