Commit
·
88786e5
1
Parent(s):
f31e622
adding file upload with image dropdown
Browse files
app.py
CHANGED
|
@@ -9,11 +9,16 @@ import streamlit as st
|
|
| 9 |
|
| 10 |
img_path = None
|
| 11 |
st.title('Semantic Segmentation using SegFormer')
|
| 12 |
-
|
| 13 |
-
|
| 14 |
'Choose any one image for inference',
|
| 15 |
('Select image', 'image1.jpg', 'image2.jpg', 'image3.jpg'))
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
if raw_image != 'Select image':
|
| 18 |
df = pd.read_csv('class_dict_seg.csv')
|
| 19 |
classes = df['name']
|
|
|
|
| 9 |
|
| 10 |
img_path = None
|
| 11 |
st.title('Semantic Segmentation using SegFormer')
|
| 12 |
+
file_upload = st.file_uploader('Raw Input Image')
|
| 13 |
+
image_path = st.selectbox(
|
| 14 |
'Choose any one image for inference',
|
| 15 |
('Select image', 'image1.jpg', 'image2.jpg', 'image3.jpg'))
|
| 16 |
|
| 17 |
+
if file_upload is None:
|
| 18 |
+
raw_image = image_path
|
| 19 |
+
else:
|
| 20 |
+
raw_image = file_upload
|
| 21 |
+
|
| 22 |
if raw_image != 'Select image':
|
| 23 |
df = pd.read_csv('class_dict_seg.csv')
|
| 24 |
classes = df['name']
|