jpterry commited on
Commit
952c48d
1 Parent(s): ae884c3

added main method

Browse files
Files changed (1) hide show
  1. app.py +27 -25
app.py CHANGED
@@ -202,31 +202,33 @@ def predict_and_analyze(model_name, num_channels, dim, image):
202
  return output, input_image, fig
203
 
204
 
205
- demo = gr.Interface(
206
- fn=predict_and_analyze,
207
- inputs=[gr.Dropdown(["regnet", "efficientnet"],
208
- value="efficientnet",
209
- label="Model Selection",
210
- show_label=True),
211
- gr.Dropdown(["45", "61", "75"],
212
- value="61",
213
- label="Number of Velocity Channels",
214
- show_label=True),
215
- gr.Dropdown(["600"],
216
- value="600",
217
- label="Image Dimensions",
218
- show_label=True),
219
- gr.File(label="Input Data", show_label=True)],
220
- outputs=[gr.Textbox(lines=1, label="Prediction", show_label=True),
221
- gr.Image(label="Input Image", show_label=True),
222
- # gr.Image(label="Activation 1", show_label=True),
223
- # gr.Image(label="Actication 2", show_label=True)],
224
- gr.Plot(label="Activations", show_label=True)
225
- # gr.Plot(label="Actication 2", show_label=True)],
226
- ],
227
- title="Kinematic Planet Detector"
228
- )
229
- demo.launch()
 
 
230
 
231
 
232
 
 
202
  return output, input_image, fig
203
 
204
 
205
+ if __name__ == "__main__":
206
+
207
+ demo = gr.Interface(
208
+ fn=predict_and_analyze,
209
+ inputs=[gr.Dropdown(["regnet", "efficientnet"],
210
+ value="efficientnet",
211
+ label="Model Selection",
212
+ show_label=True),
213
+ gr.Dropdown(["45", "61", "75"],
214
+ value="61",
215
+ label="Number of Velocity Channels",
216
+ show_label=True),
217
+ gr.Dropdown(["600"],
218
+ value="600",
219
+ label="Image Dimensions",
220
+ show_label=True),
221
+ gr.File(label="Input Data", show_label=True)],
222
+ outputs=[gr.Textbox(lines=1, label="Prediction", show_label=True),
223
+ gr.Image(label="Input Image", show_label=True),
224
+ # gr.Image(label="Activation 1", show_label=True),
225
+ # gr.Image(label="Actication 2", show_label=True)],
226
+ gr.Plot(label="Activations", show_label=True)
227
+ # gr.Plot(label="Actication 2", show_label=True)],
228
+ ],
229
+ title="Kinematic Planet Detector"
230
+ )
231
+ demo.launch()
232
 
233
 
234