Spaces:
Runtime error
Runtime error
File size: 976 Bytes
fae8864 303526c 4492910 1219687 05cdc2b bda21b3 05cdc2b 40719aa 1219687 303526c 1219687 303526c 1219687 303526c 1219687 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import streamlit as st
import os
from PIL import Image
# Define the path to the folder where images are stored
FIRE_SHOT_FOLDER = os.path.join(os.getcwd(), 'FireShot')
# Ensure the folder exists
if not os.path.exists(FIRE_SHOT_FOLDER):
st.error("FireShot folder does not exist!")
else:
st.success(f"FireShot folder found at {FIRE_SHOT_FOLDER}")
# Get list of images from the FireShot folder
image_files = [f for f in os.listdir(FIRE_SHOT_FOLDER) if f.endswith(('jpg', 'jpeg', 'png'))]
if image_files:
# Create a selectbox for the user to select an image
selected_image = st.selectbox("Select an image from the FireShot folder", image_files)
# Load and display the selected image
if selected_image:
img_path = os.path.join(FIRE_SHOT_FOLDER, selected_image)
img = Image.open(img_path)
st.image(img, caption=f"Selected Image: {selected_image}", use_column_width=True)
else:
st.info("No images found in FireShot folder.")
|