Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,9 +39,22 @@ st.markdown("""
|
|
| 39 |
# TITLE
|
| 40 |
# ---------------------------------------------------------
|
| 41 |
st.title("🏖️ Predict Maintenance")
|
| 42 |
-
st.write("The Predict Maintenance app is a tool to predict if an Engine needs any maintenance based on provided operating sensor parameters.")
|
| 43 |
-
st.write("Fill in the details below and click **Check for Maintenance** to see if the Engine needs maintenance to prevent from failure.")
|
| 44 |
-
st.write("Suggested Ranges are based on the Range of Values model trained on.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
|
|
@@ -74,11 +87,27 @@ def formatted_number_input(title, hint, minval, maxval, defvalue, steps, valform
|
|
| 74 |
return user_input
|
| 75 |
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
# ====================================
|
| 79 |
# Section : Capture Engine Parameters
|
| 80 |
# ====================================
|
| 81 |
-
st.subheader ("Engine Parameters")
|
| 82 |
|
| 83 |
# divide UI into two column layout by defining two columns
|
| 84 |
# left column is used for input and right for output
|
|
@@ -86,7 +115,8 @@ col_inputs, col_output = st.columns([3, 1.5])
|
|
| 86 |
|
| 87 |
# update contnent (input) in left input column
|
| 88 |
with col_inputs:
|
| 89 |
-
|
|
|
|
| 90 |
col_left, col_right = st.columns([1,1])
|
| 91 |
|
| 92 |
# define inputs in left column
|
|
@@ -158,6 +188,8 @@ with col_inputs:
|
|
| 158 |
valformat="%.6f"
|
| 159 |
)
|
| 160 |
|
|
|
|
|
|
|
| 161 |
#st.markdown('</div>', unsafe_allow_html=True)
|
| 162 |
|
| 163 |
#st.markdown("---")
|
|
@@ -165,11 +197,14 @@ with col_inputs:
|
|
| 165 |
#col_btn1, col_btn2, col_btn3 = st.columns([1,2,1])
|
| 166 |
|
| 167 |
with col_output:
|
| 168 |
-
st.markdown("
|
|
|
|
| 169 |
|
| 170 |
output_placeholder = st.empty()
|
| 171 |
details_placeholder = st.empty()
|
| 172 |
|
|
|
|
|
|
|
| 173 |
with col_output:
|
| 174 |
|
| 175 |
# ==========================
|
|
|
|
| 39 |
# TITLE
|
| 40 |
# ---------------------------------------------------------
|
| 41 |
st.title("🏖️ Predict Maintenance")
|
| 42 |
+
#st.write("The Predict Maintenance app is a tool to predict if an Engine needs any maintenance based on provided operating sensor parameters.")
|
| 43 |
+
#st.write("Fill in the details below and click **Check for Maintenance** to see if the Engine needs maintenance to prevent from failure.")
|
| 44 |
+
#st.write("Suggested Ranges are based on the Range of Values model trained on.")
|
| 45 |
+
st.markdown("""
|
| 46 |
+
<style>
|
| 47 |
+
.intro-text p {
|
| 48 |
+
margin-bottom: 0.4rem;
|
| 49 |
+
}
|
| 50 |
+
</style>
|
| 51 |
+
|
| 52 |
+
<div class="intro-text">
|
| 53 |
+
<p>The Predict Maintenance app is a tool to predict if an Engine needs any maintenance based on provided operating sensor parameters.</p>
|
| 54 |
+
<p>Fill in the details below and click <b>Check for Maintenance</b> to see if the Engine needs maintenance.</p>
|
| 55 |
+
<p><i>Suggested ranges are based on the range of values the model was trained on.</i></p>
|
| 56 |
+
</div>
|
| 57 |
+
""", unsafe_allow_html=True)
|
| 58 |
|
| 59 |
|
| 60 |
|
|
|
|
| 87 |
return user_input
|
| 88 |
|
| 89 |
|
| 90 |
+
st.markdown("""
|
| 91 |
+
<style>
|
| 92 |
+
.card {
|
| 93 |
+
background-color: #161b22;
|
| 94 |
+
border: 1px solid #30363d;
|
| 95 |
+
border-radius: 12px;
|
| 96 |
+
padding: 1.25rem;
|
| 97 |
+
margin-bottom: 1rem;
|
| 98 |
+
}
|
| 99 |
+
.card-title {
|
| 100 |
+
font-size: 1.2rem;
|
| 101 |
+
font-weight: 600;
|
| 102 |
+
margin-bottom: 0.75rem;
|
| 103 |
+
}
|
| 104 |
+
</style>
|
| 105 |
+
""", unsafe_allow_html=True)
|
| 106 |
|
| 107 |
# ====================================
|
| 108 |
# Section : Capture Engine Parameters
|
| 109 |
# ====================================
|
| 110 |
+
#st.subheader ("Engine Parameters")
|
| 111 |
|
| 112 |
# divide UI into two column layout by defining two columns
|
| 113 |
# left column is used for input and right for output
|
|
|
|
| 115 |
|
| 116 |
# update contnent (input) in left input column
|
| 117 |
with col_inputs:
|
| 118 |
+
|
| 119 |
+
st.markdown('<div class="card"><div class="card-title">🧩 Engine Parameters</div>', unsafe_allow_html=True)
|
| 120 |
col_left, col_right = st.columns([1,1])
|
| 121 |
|
| 122 |
# define inputs in left column
|
|
|
|
| 188 |
valformat="%.6f"
|
| 189 |
)
|
| 190 |
|
| 191 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 192 |
+
|
| 193 |
#st.markdown('</div>', unsafe_allow_html=True)
|
| 194 |
|
| 195 |
#st.markdown("---")
|
|
|
|
| 197 |
#col_btn1, col_btn2, col_btn3 = st.columns([1,2,1])
|
| 198 |
|
| 199 |
with col_output:
|
| 200 |
+
st.markdown('<div class="card"><div class="card-title">🧠 Prediction Result</div>', unsafe_allow_html=True)
|
| 201 |
+
#st.markdown("### 🧠 Prediction Result")
|
| 202 |
|
| 203 |
output_placeholder = st.empty()
|
| 204 |
details_placeholder = st.empty()
|
| 205 |
|
| 206 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
| 207 |
+
|
| 208 |
with col_output:
|
| 209 |
|
| 210 |
# ==========================
|