Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,19 @@ from PIL import Image
|
|
4 |
|
5 |
st.title('Take your picture to the next level')
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
col1, col2 = st.columns([3, 1])
|
8 |
preds = None
|
9 |
|
@@ -16,18 +29,10 @@ with col1:
|
|
16 |
with col2:
|
17 |
choice = st.selectbox('Scale to', ['x2', 'x3', 'x4'])
|
18 |
model_choice = st.selectbox('Model', ['EDSR', 'PAN', 'CARN'])
|
|
|
19 |
|
20 |
st.text(choice)
|
21 |
|
22 |
|
23 |
-
if model_choice == "EDSR":
|
24 |
-
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=choice)
|
25 |
-
else:
|
26 |
-
st.text('Not supported yet. Comeback soon for fun releases')
|
27 |
-
|
28 |
-
inputs = ImageLoader.load_image(image)
|
29 |
-
preds = model(inputs)
|
30 |
|
31 |
-
|
32 |
-
st.image(preds, cpation=f'Upscaled {choice} times image')
|
33 |
-
st.download_button('Download', preds)
|
|
|
4 |
|
5 |
st.title('Take your picture to the next level')
|
6 |
|
7 |
+
def upscale(model_choice):
|
8 |
+
if model_choice == "EDSR":
|
9 |
+
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=choice)
|
10 |
+
else:
|
11 |
+
st.text('Not supported yet. Comeback soon for fun releases')
|
12 |
+
|
13 |
+
inputs = ImageLoader.load_image(image)
|
14 |
+
preds = model(inputs)
|
15 |
+
|
16 |
+
st.subheader('New image')
|
17 |
+
st.image(preds, cpation=f'Upscaled {choice} times image')
|
18 |
+
st.download_button('Download', preds)
|
19 |
+
|
20 |
col1, col2 = st.columns([3, 1])
|
21 |
preds = None
|
22 |
|
|
|
29 |
with col2:
|
30 |
choice = st.selectbox('Scale to', ['x2', 'x3', 'x4'])
|
31 |
model_choice = st.selectbox('Model', ['EDSR', 'PAN', 'CARN'])
|
32 |
+
st.button('Upscale', on_click=upscale(model_choice))
|
33 |
|
34 |
st.text(choice)
|
35 |
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
+
|
|
|
|