Owos commited on
Commit
2aa07dc
·
1 Parent(s): 58d08f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -6,6 +6,8 @@ import random
6
  import numpy as np
7
  #import cv2
8
  from PIL import Image, ImageEnhance
 
 
9
 
10
  st.set_page_config(layout="wide")
11
  #Create two columns with different width
@@ -56,9 +58,12 @@ if uploaded_file is not None:
56
  with col2:
57
  result = Image.open('out.png')
58
  st.image(result, width=300)
59
- run =st.download_button(label="Download Image", data=result.tobytes(), file_name='afrodreams.png', mime="image/png")
 
 
 
 
60
 
61
 
62
 
63
- #img = neural_style.transfer(params)
64
 
 
6
  import numpy as np
7
  #import cv2
8
  from PIL import Image, ImageEnhance
9
+ from io import BytesIO
10
+
11
 
12
  st.set_page_config(layout="wide")
13
  #Create two columns with different width
 
58
  with col2:
59
  result = Image.open('out.png')
60
  st.image(result, width=300)
61
+ buf = BytesIO()
62
+ result.save(buf, format="JPEG")
63
+ byte_im = buf.getvalue()
64
+ run =st.download_button(label="Download Image", data=byte_im, file_name='afrodreams.png', mime="image/png")
65
+
66
 
67
 
68
 
 
69