Paras Shah
commited on
Commit
·
d5a5fe2
1
Parent(s):
1edacc8
Add help text for sliders
Browse files
app.py
CHANGED
@@ -25,20 +25,7 @@ side_bg_ext = "png"
|
|
25 |
|
26 |
st.markdown(
|
27 |
f"""
|
28 |
-
<div id="footer">
|
29 |
-
©Copyright: WII, Technology Laboratory<br>
|
30 |
-
Authors: Shashank Sawan & Paras Shah
|
31 |
-
</div>
|
32 |
<style>
|
33 |
-
#footer {{
|
34 |
-
position: fixed;
|
35 |
-
bottom: 0;
|
36 |
-
width: 95%;
|
37 |
-
padding: 5px;
|
38 |
-
text-align: right;
|
39 |
-
font-size: 14px;
|
40 |
-
z-index: 5;
|
41 |
-
}}
|
42 |
[data-testid="stSidebar"] {{
|
43 |
background: url(data:image/{side_bg_ext};base64,{base64.b64encode(open(side_bg, "rb").read()).decode()});
|
44 |
color: #ffff00;
|
@@ -81,7 +68,9 @@ st.sidebar.markdown(
|
|
81 |
"customizable canopy volume, enabling precise refinement of predictions "
|
82 |
"and analyses. By integrating species-specific and volumetric insights, "
|
83 |
"the tool enhances ecological research workflows, facilitating data-driven "
|
84 |
-
"decision-making
|
|
|
|
|
85 |
,
|
86 |
unsafe_allow_html=True,
|
87 |
)
|
@@ -106,18 +95,22 @@ with col2:
|
|
106 |
help=
|
107 |
"Adjust the Z-threshold value to calculate the canopy volume "
|
108 |
"within specified limits, it uses Quickhull and DBSCAN algorithms. "
|
109 |
-
|
110 |
-
"The Quickhull algorithm computes the convex hull of a set of points "
|
111 |
-
"by identifying extreme points to form an initial boundary and recursively "
|
112 |
-
"refining it by adding the farthest points until all points lie within the "
|
113 |
-
"convex boundary. It uses a divide-and-conquer approach, similar to QuickSort. "
|
114 |
-
|
115 |
-
"DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is a "
|
116 |
-
"density-based clustering algorithm that groups densely packed points within "
|
117 |
-
"a specified distance 'eps' and minimum points 'minpoints', while treating "
|
118 |
-
"sparse points as noise. It effectively identifies arbitrarily shaped clusters "
|
119 |
-
"and handles outliers, making it suitable for spatial data and anomaly detection."
|
120 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
col1, col2 = st.columns(2)
|
123 |
with col1:
|
@@ -132,15 +125,19 @@ with col2:
|
|
132 |
help=
|
133 |
"Adjust to calculate the DBH value within specified limits, "
|
134 |
"it utilizes Least square circle fitting method Levenberg-Marquardt "
|
135 |
-
"optimization technique."
|
136 |
-
|
137 |
-
"The Least Squares Circle Fitting method is used to find the "
|
138 |
-
"best-fitting circle to a set of 2D points by minimizing the sum of "
|
139 |
-
"squared distances between each point and the circle's circumference."
|
140 |
-
"Levenberg-Marquardt Optimization is used to fit models (like circles) "
|
141 |
-
"to point cloud data by minimizing the error between the model and the "
|
142 |
-
"actual points."
|
143 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
proceed = None
|
146 |
if uploaded_file:
|
@@ -256,7 +253,6 @@ if proceed:
|
|
256 |
predicted_label = CLASSES[predicted_class]
|
257 |
|
258 |
st.write(f"**Predicted class: {predicted_label}**")
|
259 |
-
# st.write(f"Class Probabilities: {probabilities.numpy().tolist()}")
|
260 |
st.write(f"**Confidence score: {confidence_score:.2f}%**")
|
261 |
st.write(f"**Height of tree: {height:.2f}m**")
|
262 |
st.write(f"**Canopy volume: {canopy_volume:.2f}m\u00b3**")
|
|
|
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;
|
|
|
68 |
"customizable canopy volume, enabling precise refinement of predictions "
|
69 |
"and analyses. By integrating species-specific and volumetric insights, "
|
70 |
"the tool enhances ecological research workflows, facilitating data-driven "
|
71 |
+
"decision-making.<br><br>"
|
72 |
+
"<div style='text-align: right; font-size: 10px;'>©Copyright: WII, "
|
73 |
+
"Technology Laboratory<br>Authors: Shashank Sawan & Paras Shah</div></div>"
|
74 |
,
|
75 |
unsafe_allow_html=True,
|
76 |
)
|
|
|
95 |
help=
|
96 |
"Adjust the Z-threshold value to calculate the canopy volume "
|
97 |
"within specified limits, it uses Quickhull and DBSCAN algorithms. "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
)
|
99 |
+
st.markdown(
|
100 |
+
body=
|
101 |
+
"<div style='text-align: justify; font-size: 13px;'>"
|
102 |
+
"The <b>Quickhull algorithm</b> computes the convex hull of a set of points "
|
103 |
+
"by identifying extreme points to form an initial boundary and recursively "
|
104 |
+
"refining it by adding the farthest points until all points lie within the "
|
105 |
+
"convex boundary. It uses a divide-and-conquer approach, similar to QuickSort. "
|
106 |
+
"<br>"
|
107 |
+
"<b>DBSCAN (Density-Based Spatial Clustering of Applications with Noise)</b> is "
|
108 |
+
"a density-based clustering algorithm that groups densely packed points within "
|
109 |
+
"a specified distance 'eps' and minimum points 'minpoints', while treating "
|
110 |
+
"sparse points as noise. It effectively identifies arbitrarily shaped clusters "
|
111 |
+
"and handles outliers, making it suitable for spatial data and anomaly detection.",
|
112 |
+
unsafe_allow_html=True
|
113 |
+
)
|
114 |
|
115 |
col1, col2 = st.columns(2)
|
116 |
with col1:
|
|
|
125 |
help=
|
126 |
"Adjust to calculate the DBH value within specified limits, "
|
127 |
"it utilizes Least square circle fitting method Levenberg-Marquardt "
|
128 |
+
"optimization technique."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
)
|
130 |
+
st.markdown(
|
131 |
+
body=
|
132 |
+
"<div style='text-align: justify; font-size:13px;'>"
|
133 |
+
"The <b>Least Squares Circle Fitting method</b> is used to find the "
|
134 |
+
"best-fitting circle to a set of 2D points by minimizing the sum of "
|
135 |
+
"squared distances between each point and the circle's circumference. "
|
136 |
+
"<b>Levenberg-Marquardt Optimization</b> is used to fit models "
|
137 |
+
"(like circles) to point cloud data by minimizing the error between "
|
138 |
+
"the model and the actual points.</div>",
|
139 |
+
unsafe_allow_html=True
|
140 |
+
)
|
141 |
|
142 |
proceed = None
|
143 |
if uploaded_file:
|
|
|
253 |
predicted_label = CLASSES[predicted_class]
|
254 |
|
255 |
st.write(f"**Predicted class: {predicted_label}**")
|
|
|
256 |
st.write(f"**Confidence score: {confidence_score:.2f}%**")
|
257 |
st.write(f"**Height of tree: {height:.2f}m**")
|
258 |
st.write(f"**Canopy volume: {canopy_volume:.2f}m\u00b3**")
|