Paras Shah
commited on
Commit
·
ba3a615
1
Parent(s):
846b712
Change header
Browse files- app.py +27 -28
- static/header.png +0 -0
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gc
|
2 |
import laspy
|
3 |
import torch
|
|
|
4 |
import tempfile
|
5 |
import numpy as np
|
6 |
import open3d as o3d
|
@@ -19,10 +20,31 @@ with st.spinner("Loading PointNet++ model..."):
|
|
19 |
classifier.load_state_dict(checkpoint['model_state_dict'])
|
20 |
classifier.eval()
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
st.sidebar.markdown(
|
24 |
body=
|
25 |
-
"<div style='text-align: justify;'>The species <strong>Pinus sylvestris "
|
26 |
"(Scots Pine), Fagus sylvatica (European Beech), Picea abies (Norway Spruce), "
|
27 |
"and Betula pendula (Silver Birch)</strong> are native to Europe and parts "
|
28 |
"of Asia but are also found in India (Parts of Himachal Pradesh, "
|
@@ -48,13 +70,7 @@ st.sidebar.markdown(
|
|
48 |
unsafe_allow_html=True,
|
49 |
)
|
50 |
|
51 |
-
st.image("static/header.png")
|
52 |
-
st.markdown(
|
53 |
-
"<h1>ArborSphere<br>"
|
54 |
-
"Tree Identity and Biometrics</h1>",
|
55 |
-
unsafe_allow_html=True
|
56 |
-
)
|
57 |
-
|
58 |
uploaded_file = st.file_uploader(
|
59 |
label="Upload Point Cloud Data",
|
60 |
type=['laz', 'las', 'pcd'],
|
@@ -63,7 +79,7 @@ uploaded_file = st.file_uploader(
|
|
63 |
|
64 |
col1, col2 = st.columns(2)
|
65 |
with col1:
|
66 |
-
st.image("static/canopy.png",
|
67 |
with col2:
|
68 |
CANOPY_VOLUME = st.slider(
|
69 |
label="Canopy Volume in % (Z)",
|
@@ -89,7 +105,7 @@ with col2:
|
|
89 |
|
90 |
col1, col2 = st.columns(2)
|
91 |
with col1:
|
92 |
-
st.image("static/dbh.png",
|
93 |
with col2:
|
94 |
DBH_HEIGHT = st.slider(
|
95 |
label="DBH (Diameter above Breast Height, in metres) (H)",
|
@@ -232,20 +248,3 @@ if proceed:
|
|
232 |
|
233 |
except Exception as e:
|
234 |
st.error(f"An error occured: {str(e)}")
|
235 |
-
|
236 |
-
footer="""<style>
|
237 |
-
.footer {
|
238 |
-
position: fixed;
|
239 |
-
left: 0;
|
240 |
-
bottom: 0;
|
241 |
-
width: 100%;
|
242 |
-
background-color: white;
|
243 |
-
color: black;
|
244 |
-
text-align: center;
|
245 |
-
}
|
246 |
-
</style>
|
247 |
-
<div class="footer">
|
248 |
-
<p>Developed at N-15 Tech Lab (WII, Dehradun)</p>
|
249 |
-
</div>
|
250 |
-
"""
|
251 |
-
st.markdown(footer, unsafe_allow_html=True)
|
|
|
1 |
import gc
|
2 |
import laspy
|
3 |
import torch
|
4 |
+
import base64
|
5 |
import tempfile
|
6 |
import numpy as np
|
7 |
import open3d as o3d
|
|
|
20 |
classifier.load_state_dict(checkpoint['model_state_dict'])
|
21 |
classifier.eval()
|
22 |
|
23 |
+
side_bg = "static/sidebar.png"
|
24 |
+
side_bg_ext = "png"
|
25 |
+
|
26 |
+
st.markdown(
|
27 |
+
f"""
|
28 |
+
<style>
|
29 |
+
[data-testid="stSidebar"] {{
|
30 |
+
background: url(data:image/{side_bg_ext};base64,{base64.b64encode(open(side_bg, "rb").read()).decode()});
|
31 |
+
color: #ffff00;
|
32 |
+
}}
|
33 |
+
[data-testid="stSidebar"] > div > div {{
|
34 |
+
padding-top: 3rem;
|
35 |
+
padding-bottom: 3rem;
|
36 |
+
}}
|
37 |
+
.main > div {{
|
38 |
+
padding-top: 3rem;
|
39 |
+
}}
|
40 |
+
</style>
|
41 |
+
""",
|
42 |
+
unsafe_allow_html=True
|
43 |
+
)
|
44 |
+
|
45 |
st.sidebar.markdown(
|
46 |
body=
|
47 |
+
"<div style='text-align: justify; color: #ffff00'>The species <strong>Pinus sylvestris "
|
48 |
"(Scots Pine), Fagus sylvatica (European Beech), Picea abies (Norway Spruce), "
|
49 |
"and Betula pendula (Silver Birch)</strong> are native to Europe and parts "
|
50 |
"of Asia but are also found in India (Parts of Himachal Pradesh, "
|
|
|
70 |
unsafe_allow_html=True,
|
71 |
)
|
72 |
|
73 |
+
st.image("static/header.png", use_column_width=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
uploaded_file = st.file_uploader(
|
75 |
label="Upload Point Cloud Data",
|
76 |
type=['laz', 'las', 'pcd'],
|
|
|
79 |
|
80 |
col1, col2 = st.columns(2)
|
81 |
with col1:
|
82 |
+
st.image("static/canopy.png", use_column_width=True)
|
83 |
with col2:
|
84 |
CANOPY_VOLUME = st.slider(
|
85 |
label="Canopy Volume in % (Z)",
|
|
|
105 |
|
106 |
col1, col2 = st.columns(2)
|
107 |
with col1:
|
108 |
+
st.image("static/dbh.png", use_column_width=True)
|
109 |
with col2:
|
110 |
DBH_HEIGHT = st.slider(
|
111 |
label="DBH (Diameter above Breast Height, in metres) (H)",
|
|
|
248 |
|
249 |
except Exception as e:
|
250 |
st.error(f"An error occured: {str(e)}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static/header.png
CHANGED
![]() |
![]() |