I created a new component recently. It shows an image gallery, lets the viewer select an image, and returns the selected image on the Python side. Very useful if you want to show some example images in a computer vision app!
@jrieke Nice design! But do you know how can I center these images in sidebar and change the size of these images? I would really appreciate your help!
images = [“xx.png”, “xxx.png”]
with st.sidebar:
clicked = image_select(“”, images, key=‘click_images’)
Is there a way to select and return info for multiple images? For instance, load five images on a page, select two of them and then return associated info for the two. Thanks! and nice job!
@junchi@rnobalr Thanks for the suggestions! Both things (changing alignment/size + multi-selection) are currently not implemented. Can you open Github issues on the repo? I currently don’t have plans or time to work on this but let’s track it on Github, so I can come back to it when I do have time!
@junchi I just added a parameter use_container_width in v0.3, which lets you stretch the width of the images to the container width. Does that already work for you to display them properly in the sidebar? If not, feel free to still open that Github issue and describe exactly what you want (mocks/screenshots would help!).
I think I found a kind of bug. The image-select is not updating the changes when reloading the page with new images
attendee_option = image_select(label = 'Which employee should be confirmed?', images = images, captions = attendees_desc, index = 0, return_value = 'index')
for the image_list I create temp files to store database blob image data in it. After the image-select I delete the temp. files. But still after a page reload it shows the old images. Helped myself to concatenate datetime in it, to make sure the image path will be always different.
Is there a way to show a grid of images where the user can select any number of images. I was thinking of hacking this by using streamlit-image-select and having a separate list for every image. The issue however is that the image is always clicked. @jrieke
@DrBenjamin@Ritwick_Chaudhry Can you file GitHub issues here? I don’t have time to work on this at the moment (unfortunately!) but would be great to track these issues there so I can pick them up whenever I have time.
HI ! this is great! Unfortunately, image_select sometimes fails to load images, when this happens, the component looks like never called before, there is nothing wrong with the image, it loads perfectly using st.image, I assumed that while the image was loading, another component already appeared. Is there any suggestion?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.