AleksanderObuchowski
commited on
Commit
•
70c93c5
1
Parent(s):
051e5b3
remove modal didn't like it anyways
Browse files
app.py
CHANGED
@@ -147,8 +147,6 @@ def predict_det(**det_input):
|
|
147 |
print(e)
|
148 |
|
149 |
|
150 |
-
results_modal = Modal("Results", key="results_modal")
|
151 |
-
|
152 |
col1, col2, col3 = st.columns([4, 6, 4])
|
153 |
|
154 |
with col1:
|
@@ -158,6 +156,7 @@ with col2:
|
|
158 |
# col2.image("lion Ai_black.svg", use_column_width="always", width=200)
|
159 |
st.title("SARS-CoV-2 detection")
|
160 |
st.text("Press predict after filling in the form below.")
|
|
|
161 |
with col2.expander("Examples"):
|
162 |
not_covid_example = st.button("Not COVID-19")
|
163 |
if not_covid_example:
|
@@ -165,6 +164,8 @@ with col2:
|
|
165 |
covid_example = st.button("COVID-19")
|
166 |
if covid_example:
|
167 |
st.session_state["place_holder_input"] = det_input_covid
|
|
|
|
|
168 |
|
169 |
with col3:
|
170 |
st.write(" ")
|
@@ -197,19 +198,34 @@ for col in cat_cols:
|
|
197 |
col2.write("##")
|
198 |
col2.write("##")
|
199 |
open_modal = col1.button("Predict")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
if open_modal:
|
201 |
print(f"dupa : {[value for value in det_input.values()]}")
|
202 |
if all(type(value) == str or value == 0 for value in det_input.values()):
|
203 |
st.error("No input detected. Please fill in the form and try again.")
|
204 |
-
else:
|
205 |
-
|
206 |
-
if results_modal.is_open():
|
207 |
covid = predict_det(**det_input)
|
208 |
|
209 |
-
with
|
|
|
210 |
options = {
|
211 |
-
|
212 |
-
"tooltip": {
|
|
|
|
|
|
|
213 |
# "legend": {
|
214 |
# "orient": "vertical",
|
215 |
# "left": "left",
|
@@ -235,7 +251,7 @@ if results_modal.is_open():
|
|
235 |
},
|
236 |
{
|
237 |
"value": round(1 - covid, 2) * 100,
|
238 |
-
"name": "
|
239 |
"itemStyle": {"color": "#91CC75"},
|
240 |
},
|
241 |
],
|
|
|
147 |
print(e)
|
148 |
|
149 |
|
|
|
|
|
150 |
col1, col2, col3 = st.columns([4, 6, 4])
|
151 |
|
152 |
with col1:
|
|
|
156 |
# col2.image("lion Ai_black.svg", use_column_width="always", width=200)
|
157 |
st.title("SARS-CoV-2 detection")
|
158 |
st.text("Press predict after filling in the form below.")
|
159 |
+
|
160 |
with col2.expander("Examples"):
|
161 |
not_covid_example = st.button("Not COVID-19")
|
162 |
if not_covid_example:
|
|
|
164 |
covid_example = st.button("COVID-19")
|
165 |
if covid_example:
|
166 |
st.session_state["place_holder_input"] = det_input_covid
|
167 |
+
results_container = st.empty()
|
168 |
+
|
169 |
|
170 |
with col3:
|
171 |
st.write(" ")
|
|
|
198 |
col2.write("##")
|
199 |
col2.write("##")
|
200 |
open_modal = col1.button("Predict")
|
201 |
+
|
202 |
+
col1, col2, col3 = st.columns([4, 6, 4])
|
203 |
+
|
204 |
+
with col1:
|
205 |
+
st.write(" ")
|
206 |
+
with col3:
|
207 |
+
st.write(" ")
|
208 |
+
with col2:
|
209 |
+
pass
|
210 |
+
|
211 |
+
|
212 |
if open_modal:
|
213 |
print(f"dupa : {[value for value in det_input.values()]}")
|
214 |
if all(type(value) == str or value == 0 for value in det_input.values()):
|
215 |
st.error("No input detected. Please fill in the form and try again.")
|
216 |
+
# else:
|
217 |
+
# results_modal.open()
|
218 |
+
# if results_modal.is_open():
|
219 |
covid = predict_det(**det_input)
|
220 |
|
221 |
+
with results_container.container():
|
222 |
+
st.markdown("### Results: ")
|
223 |
options = {
|
224 |
+
"title": {},
|
225 |
+
# "tooltip": {
|
226 |
+
# "trigger": "item",
|
227 |
+
# "formatter": " Probabirity of the patients CBC results being {b} is {d}%",
|
228 |
+
# },
|
229 |
# "legend": {
|
230 |
# "orient": "vertical",
|
231 |
# "left": "left",
|
|
|
251 |
},
|
252 |
{
|
253 |
"value": round(1 - covid, 2) * 100,
|
254 |
+
"name": "Normal",
|
255 |
"itemStyle": {"color": "#91CC75"},
|
256 |
},
|
257 |
],
|