Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ 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(nifti_file, actual_age
|
89 |
if not os.path.exists(nifti_file.name):
|
90 |
return "Error: MRI file not found"
|
91 |
|
@@ -138,7 +138,7 @@ with gr.Blocks() as demo:
|
|
138 |
with gr.Column(scale=1):
|
139 |
mri_input = gr.File(label="Upload a T1w MRI (NIfTI .nii.gz)")
|
140 |
age_input = gr.Number(label="Enter Age", value=50)
|
141 |
-
sex_input = gr.Radio(["Male", "Female"], label="Select Sex")
|
142 |
submit_button = gr.Button("Predict")
|
143 |
|
144 |
with gr.Column(scale=2):
|
@@ -147,7 +147,7 @@ with gr.Blocks() as demo:
|
|
147 |
|
148 |
submit_button.click(
|
149 |
fn=predict_brain_age,
|
150 |
-
inputs=[mri_input, age_input, sex_input
|
151 |
outputs=[brain_age_output, bad_output]
|
152 |
)
|
153 |
|
|
|
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"
|
91 |
|
|
|
138 |
with gr.Column(scale=1):
|
139 |
mri_input = gr.File(label="Upload a T1w MRI (NIfTI .nii.gz)")
|
140 |
age_input = gr.Number(label="Enter Age", value=50)
|
141 |
+
#sex_input = gr.Radio(["Male", "Female"], label="Select Sex")
|
142 |
submit_button = gr.Button("Predict")
|
143 |
|
144 |
with gr.Column(scale=2):
|
|
|
147 |
|
148 |
submit_button.click(
|
149 |
fn=predict_brain_age,
|
150 |
+
inputs=[mri_input, age_input], #sex_input
|
151 |
outputs=[brain_age_output, bad_output]
|
152 |
)
|
153 |
|