z-uo commited on
Commit
b274260
1 Parent(s): bd930f4

default image

Browse files
Files changed (1) hide show
  1. app.py +20 -18
app.py CHANGED
@@ -180,21 +180,23 @@ uploader = st.file_uploader('Upload your portrait here',type=['jpg','jpeg','png'
180
 
181
  if uploader is not None:
182
  pil_image = Image.open(uploader)
183
- pil_scaled, pil_depth, html_string = predict(pil_image)
184
-
185
- components.html(html_string)
186
- #st.markdown(html_string, unsafe_allow_html=True)
187
-
188
- col1, col2, col3 = st.columns(3)
189
- with col1:
190
- st.image(pil_scaled)
191
- with col2:
192
- st.image(pil_depth)
193
- with col3:
194
- with open('model.obj') as f:
195
- st.download_button('Download model.obj', f, file_name="model.obj")
196
- os.remove('model.obj')
197
- pil_depth.save('tmp.png')
198
- with open('tmp.png', "rb") as f:
199
- st.download_button('Download depth.png', f,file_name="depth.png", mime="image/png")
200
- os.remove('tmp.png')
 
 
 
180
 
181
  if uploader is not None:
182
  pil_image = Image.open(uploader)
183
+ else:
184
+ pil_image = Image.open('119_image.png')
185
+ pil_scaled, pil_depth, html_string = predict(pil_image)
186
+
187
+ components.html(html_string)
188
+ #st.markdown(html_string, unsafe_allow_html=True)
189
+
190
+ col1, col2, col3 = st.columns(3)
191
+ with col1:
192
+ st.image(pil_scaled)
193
+ with col2:
194
+ st.image(pil_depth)
195
+ with col3:
196
+ with open('model.obj') as f:
197
+ st.download_button('Download model.obj', f, file_name="model.obj")
198
+ os.remove('model.obj')
199
+ pil_depth.save('tmp.png')
200
+ with open('tmp.png', "rb") as f:
201
+ st.download_button('Download depth.png', f,file_name="depth.png", mime="image/png")
202
+ os.remove('tmp.png')