Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,10 @@ with col1:
|
|
| 17 |
file = st.file_uploader('Post your picture')
|
| 18 |
if file is not None:
|
| 19 |
image = Image.open(file)
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
if model_choice == "EDSR":
|
| 23 |
|
|
@@ -27,12 +30,12 @@ with col1:
|
|
| 27 |
|
| 28 |
ImageLoader.save_image(preds, './scaled_2x.png')
|
| 29 |
img = Image.open('./scaled_2x.png')
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
|
| 37 |
else:
|
| 38 |
st.text('Not supported yet. Comeback soon for fun releases')
|
|
|
|
| 17 |
file = st.file_uploader('Post your picture')
|
| 18 |
if file is not None:
|
| 19 |
image = Image.open(file)
|
| 20 |
+
|
| 21 |
+
col1, col2 = st.columns(2)
|
| 22 |
+
with col1:
|
| 23 |
+
st.image(image)
|
| 24 |
|
| 25 |
if model_choice == "EDSR":
|
| 26 |
|
|
|
|
| 30 |
|
| 31 |
ImageLoader.save_image(preds, './scaled_2x.png')
|
| 32 |
img = Image.open('./scaled_2x.png')
|
| 33 |
+
with col2:
|
| 34 |
+
st.subheader('New image')
|
| 35 |
+
st.image(img, caption=f'Upscaled {choice} times image')
|
| 36 |
+
|
| 37 |
+
with open('./scaled_2x.png', 'rb') as f:
|
| 38 |
+
st.download_button(label="Download image", data=f, file_name="upscaled.png", mime="image/png")
|
| 39 |
|
| 40 |
else:
|
| 41 |
st.text('Not supported yet. Comeback soon for fun releases')
|