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
|
89 |
return f"Brain Age estimate: 42"
|
90 |
|
91 |
"""
|
@@ -142,9 +142,8 @@ with gr.Blocks() as demo:
|
|
142 |
|
143 |
with gr.Row():
|
144 |
with gr.Column(scale=1):
|
145 |
-
|
146 |
-
|
147 |
-
age_input = gr.Number(label="Enter Age", value=50)
|
148 |
sex_input = gr.Radio(["Male", "Female"], label="Select Sex")
|
149 |
submit_button = gr.Button("Predict")
|
150 |
|
@@ -156,7 +155,7 @@ with gr.Blocks() as demo:
|
|
156 |
|
157 |
submit_button.click(
|
158 |
fn=predict_brain_age,
|
159 |
-
inputs=[mri_input, age_input
|
160 |
outputs=[brain_age_output, bad_output]
|
161 |
)
|
162 |
|
|
|
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 |
return f"Brain Age estimate: 42"
|
90 |
|
91 |
"""
|
|
|
142 |
|
143 |
with gr.Row():
|
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 |
|
|
|
155 |
|
156 |
submit_button.click(
|
157 |
fn=predict_brain_age,
|
158 |
+
inputs=[mri_input], # age_input, sex_input
|
159 |
outputs=[brain_age_output, bad_output]
|
160 |
)
|
161 |
|