mqadir commited on
Commit
a8ca08a
·
verified ·
1 Parent(s): 9a17ca8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 * 100
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 R1 resection: {risk_percentage:.1f}%</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,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 R1 Resection Risk Predictor")
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)