Spaces:
Sleeping
Sleeping
Update new_app.py
Browse files- new_app.py +32 -6
new_app.py
CHANGED
|
@@ -54,7 +54,19 @@ with col1:
|
|
| 54 |
_, col = st.columns(2)
|
| 55 |
with col:
|
| 56 |
st.header('Overpass Detector')
|
| 57 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
with col2:
|
| 59 |
_, col, _ = st.columns(3)
|
| 60 |
with col:
|
|
@@ -69,10 +81,6 @@ img_width = 640
|
|
| 69 |
state = st.session_state
|
| 70 |
state.loaded_model = get_model()
|
| 71 |
|
| 72 |
-
#if "loaded_model" not in state:
|
| 73 |
-
# with st.spinner('Loading model. This may take a few seconds...'):
|
| 74 |
-
# state.loaded_model = keras.models.load_model("0.0008-0.92.keras")
|
| 75 |
-
|
| 76 |
if "lat" not in state:
|
| 77 |
state.lat = 39.11
|
| 78 |
|
|
@@ -155,4 +163,22 @@ with col1:
|
|
| 155 |
|
| 156 |
st.write(f"It's {status} there's an overpass here.")
|
| 157 |
st.write("")
|
| 158 |
-
st.write(f"In fact, the likelihood of at least one overpass is {np.round(crossing_chance,decimals=2)}%.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
_, col = st.columns(2)
|
| 55 |
with col:
|
| 56 |
st.header('Overpass Detector')
|
| 57 |
+
st.markdown(
|
| 58 |
+
"""
|
| 59 |
+
<div style="
|
| 60 |
+
font-size:1.25rem;
|
| 61 |
+
margin-top:-0.3rem;
|
| 62 |
+
margin-bottom:0.6rem;
|
| 63 |
+
opacity:0.9;
|
| 64 |
+
">
|
| 65 |
+
This page runs a trained machine learning model to detect road overpasses in satellite imagery.
|
| 66 |
+
</div>
|
| 67 |
+
""",
|
| 68 |
+
unsafe_allow_html=True
|
| 69 |
+
)
|
| 70 |
with col2:
|
| 71 |
_, col, _ = st.columns(3)
|
| 72 |
with col:
|
|
|
|
| 81 |
state = st.session_state
|
| 82 |
state.loaded_model = get_model()
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
if "lat" not in state:
|
| 85 |
state.lat = 39.11
|
| 86 |
|
|
|
|
| 163 |
|
| 164 |
st.write(f"It's {status} there's an overpass here.")
|
| 165 |
st.write("")
|
| 166 |
+
st.write(f"In fact, the likelihood of at least one overpass is {np.round(crossing_chance,decimals=2)}%.")
|
| 167 |
+
|
| 168 |
+
pct = np.round(crossing_chance,decimals=2)
|
| 169 |
+
|
| 170 |
+
label = "Overpass Likely" if pct >= 50 else "Overpass Unlikely"
|
| 171 |
+
|
| 172 |
+
st.markdown(
|
| 173 |
+
f"""
|
| 174 |
+
<div style="text-align:center;">
|
| 175 |
+
<div style="font-size:2.2rem; font-weight:700; margin-bottom:0.4rem;">
|
| 176 |
+
{label}
|
| 177 |
+
</div>
|
| 178 |
+
<div style="font-size:1.35rem;">
|
| 179 |
+
Model probability: <b>{pct}%</b>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
""",
|
| 183 |
+
unsafe_allow_html=True
|
| 184 |
+
)
|