Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -155,7 +155,7 @@ with gr.Blocks() as demo:
|
|
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 |
|
@@ -179,20 +179,9 @@ else:
|
|
179 |
os.system("nvidia-smi")
|
180 |
device = torch.device("cpu")
|
181 |
|
182 |
-
#
|
183 |
download_model()
|
184 |
|
185 |
-
#
|
186 |
-
#if __name__ == "__main__":
|
187 |
-
# demo.launch(share=True)
|
188 |
-
|
189 |
-
iface = gr.Interface(
|
190 |
-
fn=predict_brain_age, # decorated with @spaces.GPU
|
191 |
-
inputs=[gr.File(label="Upload T1w MRI"), gr.Number(label="Enter Age")],
|
192 |
-
outputs=[gr.Textbox(label="Predicted Brain Age"), gr.Textbox(label="Brain Age Difference")],
|
193 |
-
title="🧠 BrainAgeNeXt",
|
194 |
-
description="Upload a T1w MRI and enter the subject's age to predict brain age."
|
195 |
-
)
|
196 |
-
|
197 |
if __name__ == "__main__":
|
198 |
-
|
|
|
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 |
|
|
|
179 |
os.system("nvidia-smi")
|
180 |
device = torch.device("cpu")
|
181 |
|
182 |
+
# Download Model Weights
|
183 |
download_model()
|
184 |
|
185 |
+
# Run Gradio App
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
if __name__ == "__main__":
|
187 |
+
demo.launch(share=True)
|