analist commited on
Commit
2ec19ea
1 Parent(s): 68970e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -3
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.camera_input('Post your picture')
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')"""