st.file_uploader returns a io.BytesIO file when I upload an image.
I’d like to cast this to a numpy array of shape
(y,x,3) but am out of my depth when it comes to understanding how to use BytesIO objects.
My current understanding is that this gives a stream of bytes, but may not provide information about how to decode the stream and reconstruct it into my choice data-structure(numpy array).
Is this assumption correct?
Does anyone know how to convert an image format into a numpy array as it’s uploaded.
I’m fine with reformatting all of my
pngs to a
jpg or whatever before I upload as long as I know how to upload something imagelike.