Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,8 +85,8 @@ 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(age): #, actual_age):
|
| 89 |
-
return f"Brain Age estimate: 42"
|
| 90 |
|
| 91 |
"""
|
| 92 |
def predict_brain_age(nifti_file, actual_age): #sex
|
|
@@ -144,7 +144,7 @@ with gr.Blocks() as demo:
|
|
| 144 |
with gr.Column(scale=1):
|
| 145 |
#mri_input = gr.File(label="Upload a T1w MRI (NIfTI .nii.gz)")
|
| 146 |
age_input = gr.Number(label="Enter Age", value=50)
|
| 147 |
-
|
| 148 |
submit_button = gr.Button("Predict")
|
| 149 |
|
| 150 |
with gr.Column(scale=2):
|
|
@@ -155,7 +155,7 @@ with gr.Blocks() as demo:
|
|
| 155 |
|
| 156 |
submit_button.click(
|
| 157 |
fn=predict_brain_age,
|
| 158 |
-
inputs=[age_input], # mri_input, sex_input
|
| 159 |
outputs=[brain_age_output, bad_output]
|
| 160 |
)
|
| 161 |
|
|
|
|
| 85 |
|
| 86 |
# 🔹 Run Brain Age Prediction (Decorated for GPU Execution)
|
| 87 |
@spaces.GPU(duration=90)
|
| 88 |
+
def predict_brain_age(age, sex): #, actual_age):
|
| 89 |
+
return f"Brain Age estimate: 42", sex
|
| 90 |
|
| 91 |
"""
|
| 92 |
def predict_brain_age(nifti_file, actual_age): #sex
|
|
|
|
| 144 |
with gr.Column(scale=1):
|
| 145 |
#mri_input = gr.File(label="Upload a T1w MRI (NIfTI .nii.gz)")
|
| 146 |
age_input = gr.Number(label="Enter Age", value=50)
|
| 147 |
+
sex_input = gr.Radio(["Male", "Female"], label="Select Sex")
|
| 148 |
submit_button = gr.Button("Predict")
|
| 149 |
|
| 150 |
with gr.Column(scale=2):
|
|
|
|
| 155 |
|
| 156 |
submit_button.click(
|
| 157 |
fn=predict_brain_age,
|
| 158 |
+
inputs=[age_input, sex_input], # mri_input, sex_input
|
| 159 |
outputs=[brain_age_output, bad_output]
|
| 160 |
)
|
| 161 |
|