Spaces:
Runtime error
Runtime error
github-actions[bot]
commited on
Commit
·
a002362
1
Parent(s):
b212166
Sync with https://github.com/mozilla-ai/osm-ai-helper
Browse files
app.py
CHANGED
|
@@ -32,13 +32,13 @@ def inference(lat_lon, margin):
|
|
| 32 |
repo_type="model",
|
| 33 |
local_dir="models",
|
| 34 |
)
|
| 35 |
-
output_path,
|
| 36 |
model_file="models/model.pt",
|
| 37 |
output_dir="results",
|
| 38 |
lat_lon=lat_lon,
|
| 39 |
margin=margin,
|
| 40 |
)
|
| 41 |
-
return output_path
|
| 42 |
|
| 43 |
|
| 44 |
@st.fragment
|
|
@@ -111,9 +111,12 @@ if st_data.get("last_clicked"):
|
|
| 111 |
streamlit_handler = StreamlitHandler()
|
| 112 |
logger.add(streamlit_handler, format="<level>{message}</level>")
|
| 113 |
|
| 114 |
-
output_path = inference(lat_lon=(lat, lon), margin=
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
|
|
|
|
|
|
|
|
|
| 118 |
|
| 119 |
-
|
|
|
|
| 32 |
repo_type="model",
|
| 33 |
local_dir="models",
|
| 34 |
)
|
| 35 |
+
output_path, existing, new, missed = run_inference(
|
| 36 |
model_file="models/model.pt",
|
| 37 |
output_dir="results",
|
| 38 |
lat_lon=lat_lon,
|
| 39 |
margin=margin,
|
| 40 |
)
|
| 41 |
+
return output_path, new
|
| 42 |
|
| 43 |
|
| 44 |
@st.fragment
|
|
|
|
| 111 |
streamlit_handler = StreamlitHandler()
|
| 112 |
logger.add(streamlit_handler, format="<level>{message}</level>")
|
| 113 |
|
| 114 |
+
output_path, new = inference(lat_lon=(lat, lon), margin=3)
|
| 115 |
|
| 116 |
+
if new:
|
| 117 |
+
st.divider()
|
| 118 |
+
st.header("Review `new` polygons")
|
| 119 |
+
for new in Path(output_path).glob("*.json"):
|
| 120 |
+
handle_polygon(new)
|
| 121 |
|
| 122 |
+
upload_results(output_path)
|