Spaces:
Runtime error
Runtime error
default image
Browse files
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 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
|
|
|
|
|
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')
|