ttcielott commited on
Commit
f43de50
·
1 Parent(s): 73f58d6

fix if clause

Browse files
Files changed (1) hide show
  1. app.py +12 -16
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
- picture = st.camera_input("Take a picture")
24
- uploaded_file = st.file_uploader("Upload a photo of your outfit")
25
 
26
  with col2:
27
- if picture:
28
- st.image(picture, width = 400)
29
- result, sugg = predict(picture)
30
- st.subheader(result)
31
- st.subheader('Pair your outfit with these colors.')
32
- st.image(sugg, width = 400)
33
- break
 
 
 
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