Spaces:
Sleeping
Sleeping
artelabsuper
commited on
Commit
·
1920ef2
1
Parent(s):
7672122
add legend
Browse files
app.py
CHANGED
@@ -40,8 +40,8 @@ state = resume(
|
|
40 |
daily_model = daily_model.eval()
|
41 |
annual_model = annual_model.eval()
|
42 |
|
43 |
-
st.title('Sentinel 2 Crop Mapping')
|
44 |
-
st.markdown('Using a
|
45 |
|
46 |
file_uploaded = st.file_uploader(
|
47 |
"Upload",
|
@@ -164,4 +164,14 @@ if st.paths is not None:
|
|
164 |
|
165 |
fig, ax = plt.subplots()
|
166 |
ax.imshow(target)
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
daily_model = daily_model.eval()
|
41 |
annual_model = annual_model.eval()
|
42 |
|
43 |
+
st.title('Lombardia Sentinel 2 Crop Mapping')
|
44 |
+
st.markdown('Using a daily FPN and giving a zip that contains 30 tiff named correctly you can reach prediction of crop mapping og the area.')
|
45 |
|
46 |
file_uploaded = st.file_uploader(
|
47 |
"Upload",
|
|
|
164 |
|
165 |
fig, ax = plt.subplots()
|
166 |
ax.imshow(target)
|
167 |
+
|
168 |
+
|
169 |
+
markdown_legend = ''
|
170 |
+
for c, l in zip(classes_color_map, labels_map):
|
171 |
+
markdown_legend += f'<div style="color:gray;background-color: rgb({c[0]*255}, {c[1]*255}, {c[2]*255});">{l}</div><br>'
|
172 |
+
|
173 |
+
col1, col2 = st.columns(2)
|
174 |
+
with col1:
|
175 |
+
st.pyplot(fig)
|
176 |
+
with col2:
|
177 |
+
st.markdown(markdown_legend, unsafe_allow_html=True)
|
utils.py
CHANGED
@@ -760,3 +760,4 @@ classes_color_map = np.array([[0., 0., 0.], # Black
|
|
760 |
[0.46666667, 0.04313725, 0.1254902],
|
761 |
[0., 0., 0.55686275]])
|
762 |
colors = classes_color_map[:8] # num classes
|
|
|
|
760 |
[0.46666667, 0.04313725, 0.1254902],
|
761 |
[0., 0., 0.55686275]])
|
762 |
colors = classes_color_map[:8] # num classes
|
763 |
+
labels_map = ['Unknown', 'Other cereals', 'Woods and other tree crops', 'Forage', 'Corn', 'Rice', 'Unknow cropland', 'No arable land']
|