github-actions[bot] commited on
Commit
a002362
·
1 Parent(s): b212166

Sync with https://github.com/mozilla-ai/osm-ai-helper

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -32,13 +32,13 @@ def inference(lat_lon, margin):
32
  repo_type="model",
33
  local_dir="models",
34
  )
35
- output_path, *_ = 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
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=1)
115
 
116
- for new in Path(output_path).glob("*.json"):
117
- handle_polygon(new)
 
 
 
118
 
119
- upload_results(output_path)
 
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)