Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -85,10 +85,6 @@ def preprocess_mri(nifti_path):
|
|
85 |
|
86 |
# Run Brain Age Prediction (Decorated for GPU Execution)
|
87 |
@spaces.GPU(duration=90)
|
88 |
-
def predict_brain_age(path, age, sex): #, actual_age):
|
89 |
-
return f"Brain Age estimate: 42", age
|
90 |
-
|
91 |
-
"""
|
92 |
def predict_brain_age(nifti_file, actual_age): #sex
|
93 |
if not os.path.exists(nifti_file.name):
|
94 |
return "Error: MRI file not found"
|
@@ -122,7 +118,7 @@ def predict_brain_age(nifti_file, actual_age): #sex
|
|
122 |
# Return formatted outputs
|
123 |
#return f"Predicted Brain Age: {predicted_brain_age_corrected:.2f} years", bad_output_html
|
124 |
return f"Predicted Brain Age: {predicted_brain_age_corrected:.2f} years", f"Brain Age Difference: {brain_age_difference:.2f} years"
|
125 |
-
|
126 |
|
127 |
# 🔹 Gradio Interface Setup
|
128 |
with gr.Blocks() as demo:
|
|
|
85 |
|
86 |
# Run Brain Age Prediction (Decorated for GPU Execution)
|
87 |
@spaces.GPU(duration=90)
|
|
|
|
|
|
|
|
|
88 |
def predict_brain_age(nifti_file, actual_age): #sex
|
89 |
if not os.path.exists(nifti_file.name):
|
90 |
return "Error: MRI file not found"
|
|
|
118 |
# Return formatted outputs
|
119 |
#return f"Predicted Brain Age: {predicted_brain_age_corrected:.2f} years", bad_output_html
|
120 |
return f"Predicted Brain Age: {predicted_brain_age_corrected:.2f} years", f"Brain Age Difference: {brain_age_difference:.2f} years"
|
121 |
+
|
122 |
|
123 |
# 🔹 Gradio Interface Setup
|
124 |
with gr.Blocks() as demo:
|