Skip to content

Commit f598ff4

Browse files
committed
Add more info in the app
1 parent 19d6ba3 commit f598ff4

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

demo/app.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def inference(lat_lon, margin):
5959
margin=margin,
6060
)
6161
st.text(f"Found: {len(new)} new polygons")
62-
return output_path, new
62+
return output_path, existing, new
6363

6464

6565
@st.fragment
@@ -119,33 +119,46 @@ def upload_results(output_path):
119119

120120
st.title("OpenStreetMap AI Helper")
121121

122+
st.markdown(
123+
"""
124+
This demo uses [mozilla-ai/swimming-pool-detector](https://huggingface.co/mozilla-ai/swimming-pool-detector).
125+
126+
You can check the [Create Dataset](https://colab.research.google.com/github/mozilla-ai//osm-ai-helper/blob/main/demo/create_dataset.ipyn)
127+
and [Finetune Model](https://colab.research.google.com/github/mozilla-ai//osm-ai-helper/blob/main/demo/finetune_model.ipynb) notebooks to learn how to train your own model.
128+
"""
129+
)
130+
122131
st.divider()
123132

124-
st.subheader("Click on the map to select a latitude and longitude")
133+
st.subheader(
134+
"Click on the map to select a latitude and longitude. The model will try to find swimming pools around this location."
135+
)
125136

126137
show_map()
127138

128139
lat_lon = st.text_input("Paste the copied (latitude, longitude)")
129140

130141
if st.button("Run Inference") and lat_lon:
131142
lat, lon = lat_lon.split(",")
132-
output_path, new = inference(
143+
output_path, existing, new = inference(
133144
lat_lon=(float(lat.strip()), float(lon.strip())), margin=2
134145
)
135146

147+
st.info(f"Found {len(existing)} swimming pools already in OpenStreetMaps.")
148+
136149
if new:
137150
st.divider()
138-
st.header("Review `new` polygons")
151+
st.header("Review `new` swimming pools")
139152
st.markdown(
140-
"Every `new` polygon will be displayed at the center of the image in `yellow`."
153+
"Every `new` swimming pool will be displayed at the center of the image in `yellow`."
141154
)
142155
st.markdown(
143-
"Polygons in other colors are those already existing in OpenStreetMap and they just "
156+
"Swimming pools in other colors are those already existing in OpenStreetMap and they just "
144157
"indicate whether the model has found them (`green`) or missed them (`red`)."
145158
)
146159
for new in Path(output_path).glob("*.json"):
147160
handle_polygon(new)
148161

149162
upload_results(output_path)
150163
else:
151-
st.warning("No `new` polygons were found. Try a different location.")
164+
st.warning("No `new` swimming pools were found. Try a different location.")

0 commit comments

Comments
 (0)