Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def predict_linear(strain, dose, soil_n, soil_p, soil_k, ph,
|
|
| 77 |
}
|
| 78 |
result_df = pd.DataFrame(data)
|
| 79 |
|
| 80 |
-
return result_df, "
|
| 81 |
|
| 82 |
# -----------------------------
|
| 83 |
# 4️⃣ Gradio Interface (Green Theme)
|
|
@@ -96,12 +96,12 @@ with gr.Blocks(
|
|
| 96 |
neutral_hue="green"
|
| 97 |
)
|
| 98 |
) as demo:
|
| 99 |
-
gr.Markdown("<h1 style='text-align:center; color:#2E8B57;'>
|
| 100 |
|
| 101 |
strain_names = ["Tetradesmus nigardi", "Clostroprosis acicularis"]
|
| 102 |
with gr.Row():
|
| 103 |
with gr.Column(scale=1):
|
| 104 |
-
gr.Markdown("###
|
| 105 |
strain_input = gr.Dropdown(
|
| 106 |
strain_names,
|
| 107 |
label="Select Strain",
|
|
@@ -109,14 +109,14 @@ with gr.Blocks(
|
|
| 109 |
)
|
| 110 |
row_selector = gr.Dropdown(row_options, label="Select Row", value="None, Enter Manually")
|
| 111 |
|
| 112 |
-
gr.Markdown("###
|
| 113 |
dose = gr.Number(label="Dose (g/pot)")
|
| 114 |
soil_n = gr.Number(label="Soil N (ppm)")
|
| 115 |
soil_p = gr.Number(label="Soil P (ppm)")
|
| 116 |
soil_k = gr.Number(label="Soil K (ppm)")
|
| 117 |
ph = gr.Number(label="pH")
|
| 118 |
|
| 119 |
-
gr.Markdown("###
|
| 120 |
chlorophyll = gr.Number(label="Chlorophyll (SPAD)")
|
| 121 |
shoot_len = gr.Number(label="Shoot Length (cm)")
|
| 122 |
root_len = gr.Number(label="Root Length (cm)")
|
|
@@ -124,10 +124,10 @@ with gr.Blocks(
|
|
| 124 |
root_wt = gr.Number(label="Root Wt (g)")
|
| 125 |
yield_gp = gr.Number(label="Yield (g/pot)")
|
| 126 |
|
| 127 |
-
predict_btn = gr.Button("
|
| 128 |
|
| 129 |
with gr.Column(scale=1):
|
| 130 |
-
gr.Markdown("###
|
| 131 |
result_table = gr.DataFrame(
|
| 132 |
headers=["Output Metric", "Actual Value", "Predicted Value", "Absolute Error"],
|
| 133 |
label="Results Comparison",
|
|
|
|
| 77 |
}
|
| 78 |
result_df = pd.DataFrame(data)
|
| 79 |
|
| 80 |
+
return result_df, "Prediction complete!", "\n".join(logs)
|
| 81 |
|
| 82 |
# -----------------------------
|
| 83 |
# 4️⃣ Gradio Interface (Green Theme)
|
|
|
|
| 96 |
neutral_hue="green"
|
| 97 |
)
|
| 98 |
) as demo:
|
| 99 |
+
gr.Markdown("<h1 style='text-align:center; color:#2E8B57;'>Linear Regression, Plant Yield Predictor</h1>")
|
| 100 |
|
| 101 |
strain_names = ["Tetradesmus nigardi", "Clostroprosis acicularis"]
|
| 102 |
with gr.Row():
|
| 103 |
with gr.Column(scale=1):
|
| 104 |
+
gr.Markdown("### Plant & Strain")
|
| 105 |
strain_input = gr.Dropdown(
|
| 106 |
strain_names,
|
| 107 |
label="Select Strain",
|
|
|
|
| 109 |
)
|
| 110 |
row_selector = gr.Dropdown(row_options, label="Select Row", value="None, Enter Manually")
|
| 111 |
|
| 112 |
+
gr.Markdown("### Input Parameters")
|
| 113 |
dose = gr.Number(label="Dose (g/pot)")
|
| 114 |
soil_n = gr.Number(label="Soil N (ppm)")
|
| 115 |
soil_p = gr.Number(label="Soil P (ppm)")
|
| 116 |
soil_k = gr.Number(label="Soil K (ppm)")
|
| 117 |
ph = gr.Number(label="pH")
|
| 118 |
|
| 119 |
+
gr.Markdown("### Autofilled Actual Metrics (from Excel)")
|
| 120 |
chlorophyll = gr.Number(label="Chlorophyll (SPAD)")
|
| 121 |
shoot_len = gr.Number(label="Shoot Length (cm)")
|
| 122 |
root_len = gr.Number(label="Root Length (cm)")
|
|
|
|
| 124 |
root_wt = gr.Number(label="Root Wt (g)")
|
| 125 |
yield_gp = gr.Number(label="Yield (g/pot)")
|
| 126 |
|
| 127 |
+
predict_btn = gr.Button("Predict", variant="primary")
|
| 128 |
|
| 129 |
with gr.Column(scale=1):
|
| 130 |
+
gr.Markdown("### Prediction Results Table")
|
| 131 |
result_table = gr.DataFrame(
|
| 132 |
headers=["Output Metric", "Actual Value", "Predicted Value", "Absolute Error"],
|
| 133 |
label="Results Comparison",
|