Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,6 @@ def img_prep(paths):
|
|
| 13 |
img = img.resize((256,256))
|
| 14 |
img = img.convert('RGB')
|
| 15 |
out.append(img)
|
| 16 |
-
st.write(np.shape(img))
|
| 17 |
return out
|
| 18 |
|
| 19 |
def model_out(img,model_path):
|
|
@@ -165,10 +164,23 @@ elif selected == 'Projects':
|
|
| 165 |
img_options = {'img1':1, 'img2':2}
|
| 166 |
img_selected_option = st.selectbox('Select an Image', img_options)
|
| 167 |
if img_selected_option == 'img1':
|
| 168 |
-
st.write(np.shape(imgs[0]))
|
| 169 |
st.image(model_out(imgs[0],'Portfolio Projects/FloodAreaSegmentationUnetPix2Pix.h5'),use_column_width=False)
|
| 170 |
if img_selected_option == 'img2':
|
| 171 |
st.image(model_out(imgs[1],'Portfolio Projects/FloodAreaSegmentationUnetPix2Pix.h5'),use_column_width=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
st.write('You selected:', selected_option)
|
| 174 |
else:
|
|
|
|
| 13 |
img = img.resize((256,256))
|
| 14 |
img = img.convert('RGB')
|
| 15 |
out.append(img)
|
|
|
|
| 16 |
return out
|
| 17 |
|
| 18 |
def model_out(img,model_path):
|
|
|
|
| 164 |
img_options = {'img1':1, 'img2':2}
|
| 165 |
img_selected_option = st.selectbox('Select an Image', img_options)
|
| 166 |
if img_selected_option == 'img1':
|
|
|
|
| 167 |
st.image(model_out(imgs[0],'Portfolio Projects/FloodAreaSegmentationUnetPix2Pix.h5'),use_column_width=False)
|
| 168 |
if img_selected_option == 'img2':
|
| 169 |
st.image(model_out(imgs[1],'Portfolio Projects/FloodAreaSegmentationUnetPix2Pix.h5'),use_column_width=False)
|
| 170 |
+
if selected_option == 'Cyclegan':
|
| 171 |
+
imgs = img_prep(['unet1.jpg','unet2.jpg'])
|
| 172 |
+
col1,col2 = st.columns(2)
|
| 173 |
+
with col1:
|
| 174 |
+
st.image(imgs[0],use_column_width=False)
|
| 175 |
+
with col2:
|
| 176 |
+
st.image(imgs[1],use_column_width=False)
|
| 177 |
+
|
| 178 |
+
img_options = {'img1':1, 'img2':2}
|
| 179 |
+
img_selected_option = st.selectbox('Select an Image', img_options)
|
| 180 |
+
if img_selected_option == 'img1':
|
| 181 |
+
st.image(model_out(imgs[0],'Portfolio Projects/photo2ukiyo.h5'),use_column_width=False)
|
| 182 |
+
if img_selected_option == 'img2':
|
| 183 |
+
st.image(model_out(imgs[1],'Portfolio Projects/photo2ukiyo.h5'),use_column_width=False)
|
| 184 |
|
| 185 |
st.write('You selected:', selected_option)
|
| 186 |
else:
|