Building a basic Streamlit file-to-image display
app
It takes a ‘file’ as ‘input’, converts each_page
as image
and then should display
all the images, where I should be able to select
and view
each image that I want
import streamlit as st
from streamlit_image_select import image_select
with st.form("key1"):
file = st.file_uploader("Choose a file")
button_check = st.form_submit_button("Button to Click")
if button_check:
with st.spinner("processing"):
with open (FILE_PATH', mode = 'wb') as w:
w.write(file.getvalue())
#extract each page of the file and save it as images
page_images = ["page_1.png", "page_2.png"]
img = image_select("Label", page_images)
st.image(img, caption = img)
This works fine, except the last part, where I am able to see all the images, but when I click
to select any image view
is always the first_image
in the list and the click
on other images in the display does not work.
Any suggestions will be helpful