New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access streamlit uploaded image in opencv #888
Comments
|
Nice! I was just about to post an example too 😄 For posterity, here's the way I did it: import cv2
import numpy as np
import streamlit as st
uploaded_file = st.file_uploader("Choose a image file", type="jpg")
if uploaded_file is not None:
# Convert the file to an opencv image.
file_bytes = np.asarray(bytearray(uploaded_file.read()), dtype=np.uint8)
opencv_image = cv2.imdecode(file_bytes, 1)
# Now do something with the image! For example, let's display it:
st.image(opencv_image, channels="BGR") |
can file_uploader upload multi image files at one time? |
Currently I coudnt do it. but I uploaded a zip file and and extracted it. After that you can iterate over the extracted zip file to do image transformations |
You can track the issue here #905 |
That‘s great! @ajinkya933 |
How to get the full path of the file? |
@ajinkya933 you sir are a life saver. Thanks a lot! |
How do I open image in opencv. I have this code which gets uploaded image and displays it on streamlit:
My question is I want to read and save this uploaded file using:
How can I achieve this ?
The text was updated successfully, but these errors were encountered: