Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
|
|
6 |
import os
|
7 |
|
8 |
# Load model
|
9 |
-
checkpoint_path = "edgilr/
|
10 |
checkpoint_and_model = model_from_checkpoint(checkpoint_path)
|
11 |
model = checkpoint_and_model["model"]
|
12 |
model_type = checkpoint_and_model["model_type"]
|
@@ -18,9 +18,9 @@ valid_tfms = tfms.A.Adapter([*tfms.A.resize_and_pad(img_size), tfms.A.Normalize(
|
|
18 |
|
19 |
# Populate examples in Gradio interface
|
20 |
examples = [
|
21 |
-
['
|
22 |
-
['
|
23 |
-
['
|
24 |
]
|
25 |
|
26 |
def show_preds(input_image):
|
@@ -38,9 +38,9 @@ def show_preds(input_image):
|
|
38 |
gr_interface = gr.Interface(
|
39 |
fn=show_preds,
|
40 |
inputs=["image"],
|
41 |
-
outputs=[gr.outputs.Image(type="pil", label="
|
42 |
-
title="
|
43 |
-
description="
|
44 |
examples=examples,
|
45 |
)
|
46 |
gr_interface.launch(inline=False, share=False, debug=True)
|
|
|
6 |
import os
|
7 |
|
8 |
# Load model
|
9 |
+
checkpoint_path = "edgilr/fasterRCNNKangaroo.pth"
|
10 |
checkpoint_and_model = model_from_checkpoint(checkpoint_path)
|
11 |
model = checkpoint_and_model["model"]
|
12 |
model_type = checkpoint_and_model["model_type"]
|
|
|
18 |
|
19 |
# Populate examples in Gradio interface
|
20 |
examples = [
|
21 |
+
['00004.jpg'],
|
22 |
+
['00083.jpg'],
|
23 |
+
['00119.jpg']
|
24 |
]
|
25 |
|
26 |
def show_preds(input_image):
|
|
|
38 |
gr_interface = gr.Interface(
|
39 |
fn=show_preds,
|
40 |
inputs=["image"],
|
41 |
+
outputs=[gr.outputs.Image(type="pil", label="FasterRCNN Inference")],
|
42 |
+
title="Kangaroo Object Detector",
|
43 |
+
description="",
|
44 |
examples=examples,
|
45 |
)
|
46 |
gr_interface.launch(inline=False, share=False, debug=True)
|