streamlit tensor image

#1
by edgarriba - opened
Kornia AI org

Does streamlit support tensors conversion ?
https://huggingface.co/spaces/kornia/kornia-augmentations-tester/blob/main/kornia_aug.py#L32

I would like to update the demo using our new IO api

Kornia AI org

streamlit's st.image only supports numpy.ndarray, [numpy.ndarray], BytesIO, str, or [str]
so we would have to convert tensor to numpy.
&
st.file_uploader returns a file like BytesIO object.
Does K.read_image_rs support files or just paths? If it does we might be able to replace:
im = Image.open(uploaded_file) with K.read_image_rs(uploaded_file)

Kornia AI org

read_image_rs return a cv::Tensor which in the end contains a bytes vector. Good experiment would be to cast that into ByteIO easily. I would love to iterate the api so that we can manage easily encoded byte streams since it's easy also for some applications im working right now in robotics to share data between grpc services

Sign up or log in to comment