Spaces:
Runtime error
Runtime error
add app
Browse files- app.py +52 -0
- requirements.txt +2 -0
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import ast
|
3 |
+
from PIL import Image
|
4 |
+
import leafmap.foliumap as leafmap
|
5 |
+
|
6 |
+
st.set_page_config(layout="wide")
|
7 |
+
image = Image.open('data/logo.png')
|
8 |
+
it_map = Image.open('data/italy_map.png')
|
9 |
+
header = st.container()
|
10 |
+
|
11 |
+
#Using "with" notation
|
12 |
+
|
13 |
+
with st.sidebar:
|
14 |
+
logo = st.image(image)
|
15 |
+
add_radio = st.radio(
|
16 |
+
"Menu",
|
17 |
+
("Home", "EDA", "Modelling", "Demo")
|
18 |
+
)
|
19 |
+
|
20 |
+
def get_layers(url):
|
21 |
+
options = leafmap.get_wms_layers(url)
|
22 |
+
return options
|
23 |
+
|
24 |
+
|
25 |
+
with header:
|
26 |
+
st.title("AI for sustainable agriculture and foood systems:Use of Satellite Imagery!")
|
27 |
+
st.text('''Over five weeks in October 2022, Omdena-Milan Local Chapter collaborators completed a local chapter challenge
|
28 |
+
on applying Artificial Intelligence (AI) and Satellite imagery for sustainable agri-food systems.To this end, the
|
29 |
+
Omdena-Milan Local Chapter collaborators explored various machine learning (ML) and data science techniques and
|
30 |
+
geographic information systems (GIS) methods. The team worked on different tasks which are independent of each other
|
31 |
+
to address the same project goal. For demonstration, the team integrated all of them into one dashboard with good usability
|
32 |
+
for non-technical decision-makers.
|
33 |
+
''')
|
34 |
+
#mp = st.image(it_map)
|
35 |
+
|
36 |
+
row1_col1, row1_col2 = st.columns([3, 1.3])
|
37 |
+
width = 800
|
38 |
+
height = 600
|
39 |
+
layers = None
|
40 |
+
|
41 |
+
|
42 |
+
url = "https://services.terrascope.be/wms/v2"
|
43 |
+
|
44 |
+
m = leafmap.Map(center=(42.3, 14), zoom=6)
|
45 |
+
|
46 |
+
if layers is not None:
|
47 |
+
for layer in layers:
|
48 |
+
m.add_wms_layer(
|
49 |
+
url, layers=layer, name=layer, attribution=" ", transparent=True
|
50 |
+
)
|
51 |
+
|
52 |
+
m.to_streamlit(height=height)
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
leafmap
|
2 |
+
owslib
|