Download display.py from jkushwaha/streamlit: direct link, hf CLI and curl.
- Browser
- Download file 433 Bytes
-
https://huggingface.co/jkushwaha/streamlit/resolve/main/display.py
- Command line
-
hf download hf://jkushwaha/streamlit/display.py
-
curl -L -o display.py https://huggingface.co/jkushwaha/streamlit/resolve/main/display.py
433 Bytes
| import streamlit as st | |
| # Dropdown with image options | |
| selected_image = st.selectbox('Select an image', ['Image 1', 'Image 2', 'Image 3']) | |
| # Dictionary mapping image names to URLs | |
| image_urls = { | |
| 'Image 1': 'https://via.placeholder.com/150', | |
| 'Image 2': 'https://via.placeholder.com/200', | |
| 'Image 3': 'https://via.placeholder.com/250' | |
| } | |
| # Display selected image | |
| st.image(image_urls[selected_image], caption=selected_image) | |