|
|
import streamlit as st |
|
|
from PIL import Image |
|
|
import time |
|
|
|
|
|
|
|
|
st.title("Streamlit Demo App") |
|
|
|
|
|
|
|
|
st.write("Welcome to the Streamlit demo app! Here you can upload files, view images, and play audio.") |
|
|
|
|
|
|
|
|
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"]) |
|
|
|
|
|
if uploaded_file is not None: |
|
|
|
|
|
image = Image.open(uploaded_file) |
|
|
st.image(image, caption='Uploaded Image.', use_column_width=True) |
|
|
|
|
|
|
|
|
audio_file = st.file_uploader("Choose an audio file...", type=["mp3", "wav"]) |
|
|
|
|
|
if audio_file is not None: |
|
|
|
|
|
st.audio(audio_file) |
|
|
|
|
|
|
|
|
with st.spinner('Loading...'): |
|
|
time.sleep(2) |
|
|
|
|
|
st.success('Done!') |
|
|
|
|
|
|
|
|
if st.button('Click me'): |
|
|
st.write("You clicked the button!") |