Access streamlit uploaded image in opencv
See original GitHub issueHow do I open image in opencv. I have this code which gets uploaded image and displays it on streamlit:
uploaded_file = st.file_uploader("Choose a image file")
if uploaded_file is not None:
image = uploaded_file.read()
img = st.image(image, caption='Sunrise by the mountains', use_column_width=True)
My question is I want to read and save this uploaded file using:
import cv2
im1=cv2.imread(image)
im2=cv2.imwrite('out.jpg', im1)
How can I achieve this ?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:8 (1 by maintainers)
Top Results From Across the Web
File Uploader File to OpenCV imread - Using Streamlit
How can I pass image file from file_uploader() to opencv's imread()? ... It returns a 'stream' class variable to access it.
Read more >How to Build an OpenCV Web App with Streamlit
In this tutorial, you'll learn how to easily convert an OpenCV project into a web app that you can showcase. You'll use a...
Read more >Working with File Uploads in Streamlit Python - JCharisTech
In this tutorial we will be exploring streamlit file upload feature. ... Hence if it is an image you will have to use...
Read more >Create A Photo Editing App Using Streamlit
Create A Photo Editing App Using Streamlit — Surprisingly Easy and Fun · Introduction · Pre-requisite · Launch Streamlit · Import Libraries ·...
Read more >Working with File Uploads In Streamlit Python - YouTube
In this indepth tutorial we will be working with the file uploads feature of streamlit - how to process Images,PDF,Docx,Txt,CSV etc.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nice! I was just about to post an example too 😄
For posterity, here’s the way I did it: