Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -158,7 +158,7 @@ with col_inputs:
|
|
| 158 |
|
| 159 |
|
| 160 |
oil_pressure = formatted_number_input(
|
| 161 |
-
"Lubricating oil pressure
|
| 162 |
"0.001 to 10.0",
|
| 163 |
minval=0.001,
|
| 164 |
maxval=10.0,
|
|
@@ -169,7 +169,7 @@ with col_inputs:
|
|
| 169 |
|
| 170 |
|
| 171 |
fuel_pressure = formatted_number_input(
|
| 172 |
-
"Fuel Pressure
|
| 173 |
"0.01 to 25.0",
|
| 174 |
minval=0.01,
|
| 175 |
maxval=25.0,
|
|
@@ -181,7 +181,7 @@ with col_inputs:
|
|
| 181 |
# define inputs in left column
|
| 182 |
with col_right:
|
| 183 |
coolant_pressure = formatted_number_input(
|
| 184 |
-
"Coolant Pressure
|
| 185 |
"0.01 to 10.0",
|
| 186 |
minval=0.01,
|
| 187 |
maxval=10.0,
|
|
@@ -192,7 +192,7 @@ with col_inputs:
|
|
| 192 |
|
| 193 |
|
| 194 |
lub_oil_temp = formatted_number_input(
|
| 195 |
-
"Lubricating oil Temperature
|
| 196 |
"50.0 to 100.0",
|
| 197 |
minval=50.0,
|
| 198 |
maxval=100.0,
|
|
@@ -203,7 +203,7 @@ with col_inputs:
|
|
| 203 |
|
| 204 |
|
| 205 |
coolant_temp = formatted_number_input(
|
| 206 |
-
"Coolant Temperature
|
| 207 |
"50.0 to 200.0",
|
| 208 |
minval=50.0,
|
| 209 |
maxval=200.0,
|
|
@@ -212,7 +212,7 @@ with col_inputs:
|
|
| 212 |
valformat="%.6f"
|
| 213 |
)
|
| 214 |
|
| 215 |
-
submitted = st.form_submit_button("🚀 Check
|
| 216 |
|
| 217 |
|
| 218 |
with col_output:
|
|
@@ -307,12 +307,12 @@ st.markdown("---")
|
|
| 307 |
|
| 308 |
st.subheader ("Batch Prediction for Engine Maintenance")
|
| 309 |
st.markdown("""
|
| 310 |
-
*Select csv file engine sensor parameters to find prediction for all readings*
|
| 311 |
""")
|
| 312 |
|
| 313 |
file = st.file_uploader ("Upload CSV file", type=["csv"])
|
| 314 |
|
| 315 |
-
if file is not None and st.button("
|
| 316 |
|
| 317 |
inputfile = {"file": (file.name, file.getvalue(), "text/csv")}
|
| 318 |
response = requests.post(
|
|
@@ -345,6 +345,11 @@ if file is not None and st.button("Predict Batch"):
|
|
| 345 |
input_df["Probability"] = probabilities
|
| 346 |
|
| 347 |
st.success("Batch prediction completed successfully")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 348 |
|
| 349 |
# Show combined dataframe
|
| 350 |
st.dataframe(input_df, use_container_width=True)
|
|
|
|
| 158 |
|
| 159 |
|
| 160 |
oil_pressure = formatted_number_input(
|
| 161 |
+
"Lubricating oil pressure in kPa",
|
| 162 |
"0.001 to 10.0",
|
| 163 |
minval=0.001,
|
| 164 |
maxval=10.0,
|
|
|
|
| 169 |
|
| 170 |
|
| 171 |
fuel_pressure = formatted_number_input(
|
| 172 |
+
"Fuel Pressure in kPa",
|
| 173 |
"0.01 to 25.0",
|
| 174 |
minval=0.01,
|
| 175 |
maxval=25.0,
|
|
|
|
| 181 |
# define inputs in left column
|
| 182 |
with col_right:
|
| 183 |
coolant_pressure = formatted_number_input(
|
| 184 |
+
"Coolant Pressure in kPa",
|
| 185 |
"0.01 to 10.0",
|
| 186 |
minval=0.01,
|
| 187 |
maxval=10.0,
|
|
|
|
| 192 |
|
| 193 |
|
| 194 |
lub_oil_temp = formatted_number_input(
|
| 195 |
+
"Lubricating oil Temperature in °C",
|
| 196 |
"50.0 to 100.0",
|
| 197 |
minval=50.0,
|
| 198 |
maxval=100.0,
|
|
|
|
| 203 |
|
| 204 |
|
| 205 |
coolant_temp = formatted_number_input(
|
| 206 |
+
"Coolant Temperature in °C",
|
| 207 |
"50.0 to 200.0",
|
| 208 |
minval=50.0,
|
| 209 |
maxval=200.0,
|
|
|
|
| 212 |
valformat="%.6f"
|
| 213 |
)
|
| 214 |
|
| 215 |
+
submitted = st.form_submit_button("🚀 Check Maintenance")
|
| 216 |
|
| 217 |
|
| 218 |
with col_output:
|
|
|
|
| 307 |
|
| 308 |
st.subheader ("Batch Prediction for Engine Maintenance")
|
| 309 |
st.markdown("""
|
| 310 |
+
*Select csv file with engine sensor parameters to find prediction for all readings*
|
| 311 |
""")
|
| 312 |
|
| 313 |
file = st.file_uploader ("Upload CSV file", type=["csv"])
|
| 314 |
|
| 315 |
+
if file is not None and st.button("🚀 Check Maintenance"):
|
| 316 |
|
| 317 |
inputfile = {"file": (file.name, file.getvalue(), "text/csv")}
|
| 318 |
response = requests.post(
|
|
|
|
| 345 |
input_df["Probability"] = probabilities
|
| 346 |
|
| 347 |
st.success("Batch prediction completed successfully")
|
| 348 |
+
|
| 349 |
+
st.markdown("""
|
| 350 |
+
*Prediction : 1 deontes Maintenance is needed*
|
| 351 |
+
*Probability : Indicates failure probability and value ranges from 0.0 to 1.0. Value of 0.5 (50%) and above is suggested for Maintenance*
|
| 352 |
+
""")
|
| 353 |
|
| 354 |
# Show combined dataframe
|
| 355 |
st.dataframe(input_df, use_container_width=True)
|