Spaces:
Build error
Build error
Reformat block layout
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ title = '<h1 style="text-align: center;">Segment Brain Tumors with MONAI! 🧠 <
|
|
22 |
description = """
|
23 |
## To run 🚀
|
24 |
|
25 |
-
Upload a
|
26 |
If you want to see a different slice, update the slider and click the button.
|
27 |
|
28 |
More details on the model can be found [here!](https://huggingface.co/katielink/brats_mri_segmentation_v0.1.0)
|
@@ -41,7 +41,7 @@ references = """
|
|
41 |
"""
|
42 |
|
43 |
examples = [
|
44 |
-
['examples/BRATS_485.nii.gz',
|
45 |
['examples/BRATS_486.nii.gz', 100]
|
46 |
]
|
47 |
|
@@ -125,18 +125,23 @@ with gr.Blocks() as demo:
|
|
125 |
gr.Markdown(description)
|
126 |
|
127 |
with gr.Row():
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
133 |
with gr.Column():
|
134 |
# Show the input image with different MR sequences
|
135 |
input_image = gr.Gallery(label='input MRI sequences (T1+, T1, T2, FLAIR)')
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
|
|
140 |
|
141 |
# Run prediction on button click
|
142 |
button.click(
|
|
|
22 |
description = """
|
23 |
## To run 🚀
|
24 |
|
25 |
+
Upload a brain MRI image file, or try out one of the examples below!
|
26 |
If you want to see a different slice, update the slider and click the button.
|
27 |
|
28 |
More details on the model can be found [here!](https://huggingface.co/katielink/brats_mri_segmentation_v0.1.0)
|
|
|
41 |
"""
|
42 |
|
43 |
examples = [
|
44 |
+
['examples/BRATS_485.nii.gz', 65],
|
45 |
['examples/BRATS_486.nii.gz', 100]
|
46 |
]
|
47 |
|
|
|
125 |
gr.Markdown(description)
|
126 |
|
127 |
with gr.Row():
|
128 |
+
# Get the input file and slice slider as inputs
|
129 |
+
input_file = gr.File(label='input file')
|
130 |
+
z_axis = gr.Slider(0, 200, label='z-axis', value=50)
|
131 |
+
|
132 |
+
with gr.Row():
|
133 |
+
# Show the button with custom label
|
134 |
+
button = gr.Button("Segment Tumor!")
|
135 |
+
|
136 |
+
with gr.Row():
|
137 |
with gr.Column():
|
138 |
# Show the input image with different MR sequences
|
139 |
input_image = gr.Gallery(label='input MRI sequences (T1+, T1, T2, FLAIR)')
|
140 |
+
|
141 |
+
with gr.Column():
|
142 |
+
# Show the segmentation labels
|
143 |
+
output_segmentation = gr.Gallery(label='output segmentations (TC, WT, ET)')
|
144 |
+
|
145 |
|
146 |
# Run prediction on button click
|
147 |
button.click(
|