analist commited on
Commit
6afed95
1 Parent(s): 0d5cc5c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,6 +1,7 @@
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
 
@@ -24,11 +25,12 @@ with col1:
24
  inputs = ImageLoader.load_image(image)
25
  preds = model(inputs)
26
 
27
- for i in range(101):
28
- st.progress(i, text='Magic is happening')
 
29
  st.subheader('New image')
30
- st.image(preds, caption=f'Upscaled {choice} times image')
31
- st.download_button('Download', preds)
32
 
33
  else:
34
  st.text('Not supported yet. Comeback soon for fun releases')
 
1
  import streamlit as st
2
  from super_image import EdsrModel, ImageLoader
3
  from PIL import Image
4
+ import cv2
5
 
6
  st.title('Take your picture to the next level')
7
 
 
25
  inputs = ImageLoader.load_image(image)
26
  preds = model(inputs)
27
 
28
+ ImageLoader.save_image(preds, './scaled_2x.png')
29
+ img = cv2.imread('./scaled_2x.png')
30
+
31
  st.subheader('New image')
32
+ st.image(img, caption=f'Upscaled {choice} times image')
33
+ st.download_button('Download', img)
34
 
35
  else:
36
  st.text('Not supported yet. Comeback soon for fun releases')