added main method
Browse files
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 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
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 |
|