ChrisMofus commited on
Commit
4473c1b
1 Parent(s): b3dfb2c

Add image uploader

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -1,4 +1,8 @@
1
  import streamlit as st
 
2
 
3
- x = st.slider('Select a value')
4
- st.write(x, 'squared is', x * x)
 
 
 
 
1
  import streamlit as st
2
+ from PIL import Image
3
 
4
+ uploaded_file = st.file_uploader("Choose an image...", type="jpg")
5
+
6
+ if uploaded_file is not None:
7
+ image = Image.open(uploaded_file)
8
+ st.image(image, caption='Uploaded Image.', use_column_width=True)