jalFaizy commited on
Commit
0d43e79
·
1 Parent(s): 95f4b63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -14
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
- model = from_pretrained_keras('jalFaizy/3D_CNN')
102
-
103
- inputs = gr.inputs.File()
104
- outputs = [gr.outputs.Textbox(), 'plot']
105
-
106
- iface = gr.Interface(
107
- infer,
108
- inputs,
109
- outputs,
110
- title='3D CNN for CT scans',
111
- examples=['example_1_normal.nii.gz']
112
- )
113
-
114
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)