Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -118,9 +118,9 @@ def calculate_risk_and_format(mask_path, no_chemo, pd_surgery):
|
|
| 118 |
prob_r1 = 0.72 # Fallback dummy
|
| 119 |
|
| 120 |
# 5. Format Outputs
|
| 121 |
-
risk_percentage = prob_r1
|
| 122 |
risk_color = "red" if risk_percentage > 50 else "green"
|
| 123 |
-
risk_display = f"<h2 style='color: {risk_color}; margin-top: 0;'>Predicted probability of
|
| 124 |
|
| 125 |
# Notice we still display the RAW un-normalized values to the user in the UI,
|
| 126 |
# but the model calculates risk using the SCALED values.
|
|
@@ -193,7 +193,7 @@ def process_presegmented_mask(mask_file, no_chemo, pd_surgery):
|
|
| 193 |
# GRADIO UI LAYOUT
|
| 194 |
|
| 195 |
with gr.Blocks() as demo:
|
| 196 |
-
gr.Markdown("# Preoperative
|
| 197 |
|
| 198 |
with gr.Row():
|
| 199 |
# LEFT COLUMN: Inputs (Tabs + Clinical Data)
|
|
|
|
| 118 |
prob_r1 = 0.72 # Fallback dummy
|
| 119 |
|
| 120 |
# 5. Format Outputs
|
| 121 |
+
risk_percentage = prob_r1
|
| 122 |
risk_color = "red" if risk_percentage > 50 else "green"
|
| 123 |
+
risk_display = f"<h2 style='color: {risk_color}; margin-top: 0;'>Predicted probability of R+ resection: {risk_percentage:.2f}%</h2>"
|
| 124 |
|
| 125 |
# Notice we still display the RAW un-normalized values to the user in the UI,
|
| 126 |
# but the model calculates risk using the SCALED values.
|
|
|
|
| 193 |
# GRADIO UI LAYOUT
|
| 194 |
|
| 195 |
with gr.Blocks() as demo:
|
| 196 |
+
gr.Markdown("# Preoperative PDAC R+ Resection Risk Predictor")
|
| 197 |
|
| 198 |
with gr.Row():
|
| 199 |
# LEFT COLUMN: Inputs (Tabs + Clinical Data)
|