Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,17 +98,31 @@ def infer(filename):
|
|
| 98 |
|
| 99 |
return result, plot_slices(2, 10, 128, 128, vol[0, :, :, :20])
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
return result, plot_slices(2, 10, 128, 128, vol[0, :, :, :20])
|
| 100 |
|
| 101 |
+
if __name__ == "__main__":
|
| 102 |
+
model = from_pretrained_keras('jalFaizy/3D_CNN')
|
| 103 |
+
|
| 104 |
+
inputs = gr.inputs.File()
|
| 105 |
+
outputs = [gr.outputs.Textbox(), 'plot']
|
| 106 |
+
|
| 107 |
+
title = "3D CNN for CT scans"
|
| 108 |
+
description = """This space implements 3D convolutional neural network to predict the presence of viral pneumonia in computer tomography scans.
|
| 109 |
+
"""
|
| 110 |
+
article = """
|
| 111 |
+
<p style='text-align: center'>
|
| 112 |
+
<a href='https://keras.io/examples/vision/3D_image_classification/' target='_blank'>Keras Example given by Hasib Zunair</a>
|
| 113 |
+
<br>
|
| 114 |
+
Space by Faizan Shaikh
|
| 115 |
+
</p>
|
| 116 |
+
"""
|
| 117 |
+
|
| 118 |
+
iface = gr.Interface(
|
| 119 |
+
infer,
|
| 120 |
+
inputs,
|
| 121 |
+
outputs,
|
| 122 |
+
title=title,
|
| 123 |
+
description=description,
|
| 124 |
+
article=article,
|
| 125 |
+
examples=['example_1_normal.nii.gz']
|
| 126 |
+
)
|
| 127 |
+
|
| 128 |
+
iface.launch(enable_queue=True)
|