Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -87,6 +87,10 @@ def preprocess_mri(nifti_path):
|
|
87 |
@spaces.GPU(duration=90)
|
88 |
def predict_brain_age(nifti_file, actual_age):
|
89 |
return f"Brain Age estimate: 42"
|
|
|
|
|
|
|
|
|
90 |
"""
|
91 |
def predict_brain_age(nifti_file, actual_age): #sex
|
92 |
if not os.path.exists(nifti_file.name):
|
@@ -153,9 +157,9 @@ with gr.Blocks() as demo:
|
|
153 |
bad_output = gr.Textbox(label="Brain Age Difference", interactive=False)
|
154 |
|
155 |
submit_button.click(
|
156 |
-
fn=
|
157 |
-
|
158 |
-
|
159 |
)
|
160 |
|
161 |
gr.Markdown("""
|
|
|
87 |
@spaces.GPU(duration=90)
|
88 |
def predict_brain_age(nifti_file, actual_age):
|
89 |
return f"Brain Age estimate: 42"
|
90 |
+
|
91 |
+
def predict_brain_age_wrapper(nifti_file: gr.File, actual_age: float) -> tuple[str, str]:
|
92 |
+
return predict_brain_age(nifti_file, actual_age)
|
93 |
+
|
94 |
"""
|
95 |
def predict_brain_age(nifti_file, actual_age): #sex
|
96 |
if not os.path.exists(nifti_file.name):
|
|
|
157 |
bad_output = gr.Textbox(label="Brain Age Difference", interactive=False)
|
158 |
|
159 |
submit_button.click(
|
160 |
+
fn=predict_brain_age_wrapper,
|
161 |
+
inputs=[mri_input, age_input], #sex_input
|
162 |
+
outputs=[brain_age_output, bad_output]
|
163 |
)
|
164 |
|
165 |
gr.Markdown("""
|