Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,28 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
|
| 3 |
st.title('Take your picture to the next level')
|
| 4 |
|
| 5 |
col1, col2 = st.columns([3, 1])
|
| 6 |
|
| 7 |
with col1:
|
| 8 |
-
st.
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
with col2:
|
| 11 |
choice = st.selectbox('Scale to', ['x2', 'x3', 'x4'])
|
| 12 |
model_choice = st.selectbox('Model', ['EDSR', 'PAN', 'CARN'])
|
| 13 |
|
| 14 |
-
st.text(choice)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from super_image import EdsrModel, ImageLoader
|
| 3 |
+
from PIL import Image
|
| 4 |
|
| 5 |
st.title('Take your picture to the next level')
|
| 6 |
|
| 7 |
col1, col2 = st.columns([3, 1])
|
| 8 |
|
| 9 |
with col1:
|
| 10 |
+
file = st.file_uploader('Post your picture')
|
| 11 |
+
if file is not None:
|
| 12 |
+
image = Image.open(image)
|
| 13 |
+
st.image(image)
|
| 14 |
+
|
| 15 |
with col2:
|
| 16 |
choice = st.selectbox('Scale to', ['x2', 'x3', 'x4'])
|
| 17 |
model_choice = st.selectbox('Model', ['EDSR', 'PAN', 'CARN'])
|
| 18 |
|
| 19 |
+
st.text(choice)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
"""
|
| 23 |
+
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=2)
|
| 24 |
+
inputs = ImageLoader.load_image(image)
|
| 25 |
+
preds = model(inputs)
|
| 26 |
+
|
| 27 |
+
ImageLoader.save_image(preds, './scaled_2x.png')
|
| 28 |
+
ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')"""
|