jeremyLE-Ekimetrics commited on
Commit
69b90e4
·
1 Parent(s): 3f2f80d
Files changed (1) hide show
  1. biomap/streamlit_app.py +3 -8
biomap/streamlit_app.py CHANGED
@@ -61,19 +61,12 @@ def app(model):
61
  st.markdown("<p style='text-align: center;'>Land use is divided into 6 differents classes :Each class is assigned a GBS score from 0 to 1</p>", unsafe_allow_html=True)
62
  st.markdown("<p style='text-align: center;'>Buildings : 0.1 | Infrastructure : 0.1 | Cultivation : 0.4 | Wetland : 0.9 | Water : 0.9 | Natural green : 1 </p>", unsafe_allow_html=True)
63
  st.markdown("<p style='text-align: center;'>The score is then average on the full image.</p>", unsafe_allow_html=True)
64
-
65
- if st.session_state["infered"]:
66
- st.plotly_chart(st.session_state["previous_fig"], use_container_width=True)
67
 
68
  col_1, col_2 = st.columns([0.5,0.5])
69
  with col_1:
70
  m = folium.Map(location=[DEFAULT_LATITUDE, DEFAULT_LONGITUDE], zoom_start=DEFAULT_ZOOM)
71
-
72
- # The code below will be responsible for displaying
73
- # the popup with the latitude and longitude shown
74
  m.add_child(folium.LatLngPopup())
75
  f_map = st_folium(m, width=FOLIUM_WIDTH, height=FOLIUM_HEIGHT)
76
-
77
 
78
  selected_latitude = DEFAULT_LATITUDE
79
  selected_longitude = DEFAULT_LONGITUDE
@@ -88,7 +81,6 @@ def app(model):
88
  lat = st.text_input("lattitude", value=selected_latitude)
89
  long = st.text_input("longitude", value=selected_longitude)
90
 
91
-
92
  years = list(range(MIN_YEAR, MAX_YEAR, 1))
93
  start_date = st.selectbox("Start date", years)
94
 
@@ -115,6 +107,9 @@ def app(model):
115
  fig = inference_on_location_and_month(model, lat, long, date)
116
  st.session_state["infered"] = True
117
  st.session_state["previous_fig"] = fig
 
 
 
118
 
119
 
120
  if __name__ == "__main__":
 
61
  st.markdown("<p style='text-align: center;'>Land use is divided into 6 differents classes :Each class is assigned a GBS score from 0 to 1</p>", unsafe_allow_html=True)
62
  st.markdown("<p style='text-align: center;'>Buildings : 0.1 | Infrastructure : 0.1 | Cultivation : 0.4 | Wetland : 0.9 | Water : 0.9 | Natural green : 1 </p>", unsafe_allow_html=True)
63
  st.markdown("<p style='text-align: center;'>The score is then average on the full image.</p>", unsafe_allow_html=True)
 
 
 
64
 
65
  col_1, col_2 = st.columns([0.5,0.5])
66
  with col_1:
67
  m = folium.Map(location=[DEFAULT_LATITUDE, DEFAULT_LONGITUDE], zoom_start=DEFAULT_ZOOM)
 
 
 
68
  m.add_child(folium.LatLngPopup())
69
  f_map = st_folium(m, width=FOLIUM_WIDTH, height=FOLIUM_HEIGHT)
 
70
 
71
  selected_latitude = DEFAULT_LATITUDE
72
  selected_longitude = DEFAULT_LONGITUDE
 
81
  lat = st.text_input("lattitude", value=selected_latitude)
82
  long = st.text_input("longitude", value=selected_longitude)
83
 
 
84
  years = list(range(MIN_YEAR, MAX_YEAR, 1))
85
  start_date = st.selectbox("Start date", years)
86
 
 
107
  fig = inference_on_location_and_month(model, lat, long, date)
108
  st.session_state["infered"] = True
109
  st.session_state["previous_fig"] = fig
110
+
111
+ if st.session_state["infered"]:
112
+ st.plotly_chart(st.session_state["previous_fig"], use_container_width=True)
113
 
114
 
115
  if __name__ == "__main__":