analist commited on
Commit
c5b1dc0
1 Parent(s): 581ddb4

Update app.py

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