Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,7 @@ SIDEBAR_OPTION_DEMO_IMAGE = "Select a Demo Image"
|
|
119 |
SIDEBAR_OPTION_UPLOAD_IMAGE = "Upload an Image"
|
120 |
SIDEBAR_OPTION_COLOUR_IMAGE = "Choose a colour"
|
121 |
|
122 |
-
SIDEBAR_OPTIONS = [SIDEBAR_OPTION_DEMO_IMAGE, SIDEBAR_OPTION_UPLOAD_IMAGE
|
123 |
|
124 |
|
125 |
app_mode = st.sidebar.selectbox("Please select from the following", SIDEBAR_OPTIONS)
|
@@ -133,7 +133,7 @@ if app_mode == SIDEBAR_OPTION_DEMO_IMAGE:
|
|
133 |
colour[0] = clr[0]
|
134 |
colour[1] = clr[1]
|
135 |
colour[2] = clr[2]
|
136 |
-
if app_mode == SIDEBAR_OPTION_DEMO_IMAGE:
|
137 |
st.sidebar.write(" ------ ")
|
138 |
option = st.sidebar.selectbox('Please select a sample image, then click Magic Time button', photos)
|
139 |
pressed = st.sidebar.button('PoP')
|
@@ -141,8 +141,14 @@ if app_mode == SIDEBAR_OPTION_DEMO_IMAGE:
|
|
141 |
st.empty()
|
142 |
st.sidebar.write('Please wait for the magic to happen! This may take up to a minute.')
|
143 |
predict(option,option2)
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
uploaded_file = st.file_uploader("Choose an image...")
|
147 |
if uploaded_file is not None:
|
148 |
predict(uploaded_file,option2)
|
|
|
119 |
SIDEBAR_OPTION_UPLOAD_IMAGE = "Upload an Image"
|
120 |
SIDEBAR_OPTION_COLOUR_IMAGE = "Choose a colour"
|
121 |
|
122 |
+
SIDEBAR_OPTIONS = [SIDEBAR_OPTION_DEMO_IMAGE, SIDEBAR_OPTION_UPLOAD_IMAGE]
|
123 |
|
124 |
|
125 |
app_mode = st.sidebar.selectbox("Please select from the following", SIDEBAR_OPTIONS)
|
|
|
133 |
colour[0] = clr[0]
|
134 |
colour[1] = clr[1]
|
135 |
colour[2] = clr[2]
|
136 |
+
if app_mode == SIDEBAR_OPTION_DEMO_IMAGE:
|
137 |
st.sidebar.write(" ------ ")
|
138 |
option = st.sidebar.selectbox('Please select a sample image, then click Magic Time button', photos)
|
139 |
pressed = st.sidebar.button('PoP')
|
|
|
141 |
st.empty()
|
142 |
st.sidebar.write('Please wait for the magic to happen! This may take up to a minute.')
|
143 |
predict(option,option2)
|
144 |
+
else:
|
145 |
+
if app_mode == SIDEBAR_OPTION_DEMO_IMAGE:
|
146 |
+
st.sidebar.write(" ------ ")
|
147 |
+
option2 = st.sidebar.selectbox('Please select a sample image, then click Magic Time button', colour)
|
148 |
+
colour[0] = clr[0]
|
149 |
+
colour[1] = clr[1]
|
150 |
+
colour[2] = clr[2]
|
151 |
+
if app_mode == SIDEBAR_OPTION_UPLOAD_IMAGE:
|
152 |
uploaded_file = st.file_uploader("Choose an image...")
|
153 |
if uploaded_file is not None:
|
154 |
predict(uploaded_file,option2)
|