Spaces:
Runtime error
Runtime error
ttcielott
commited on
Commit
·
f43de50
1
Parent(s):
73f58d6
fix if clause
Browse files
app.py
CHANGED
@@ -20,22 +20,18 @@ def predict(img):
|
|
20 |
with col1:
|
21 |
st.subheader("Take a photo of your outfit or upload the photo.")
|
22 |
st.write("Please stay in natural light or any light reflecting the original color of your outfit.")
|
23 |
-
|
24 |
-
|
25 |
|
26 |
with col2:
|
27 |
-
if
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
34 |
|
35 |
-
if uploaded_file:
|
36 |
-
st.image(uploaded_file, width = 400)
|
37 |
-
result, sugg = predict(uploaded_file)
|
38 |
-
st.subheader(result)
|
39 |
-
st.subheader('Pair your outfit with these colors.')
|
40 |
-
st.image(sugg, width = 400)
|
41 |
-
break
|
|
|
20 |
with col1:
|
21 |
st.subheader("Take a photo of your outfit or upload the photo.")
|
22 |
st.write("Please stay in natural light or any light reflecting the original color of your outfit.")
|
23 |
+
camera = st.camera_input("Take a picture")
|
24 |
+
upload = st.file_uploader("Upload a photo of your outfit")
|
25 |
|
26 |
with col2:
|
27 |
+
if camera:
|
28 |
+
img = camera
|
29 |
+
elif upload:
|
30 |
+
img = upload
|
31 |
+
|
32 |
+
st.image(img, width = 400)
|
33 |
+
result, sugg = predict(ime)
|
34 |
+
st.subheader(result)
|
35 |
+
st.subheader('Pair your outfit with these colors.')
|
36 |
+
st.image(sugg, width = 400)
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|