Commit
·
630bf88
1
Parent(s):
c725d2e
Output data about detected object
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def predict(image, threshold=0.25, model_id=None):
|
|
34 |
results = model(image, size=input_size)
|
35 |
numpy_image = results.render()[0]
|
36 |
output_image = Image.fromarray(numpy_image)
|
37 |
-
return output_image
|
38 |
|
39 |
|
40 |
gr.Interface(
|
@@ -47,7 +47,10 @@ gr.Interface(
|
|
47 |
gr.Slider(maximum=1, step=0.01, value=0.25),
|
48 |
gr.Dropdown(models_ids, value=models_ids[-1]),
|
49 |
],
|
50 |
-
outputs=
|
|
|
|
|
|
|
51 |
examples=examples,
|
52 |
cache_examples=True if examples else False,
|
53 |
).launch(enable_queue=True)
|
|
|
34 |
results = model(image, size=input_size)
|
35 |
numpy_image = results.render()[0]
|
36 |
output_image = Image.fromarray(numpy_image)
|
37 |
+
return (output_image, str(results.pred))
|
38 |
|
39 |
|
40 |
gr.Interface(
|
|
|
47 |
gr.Slider(maximum=1, step=0.01, value=0.25),
|
48 |
gr.Dropdown(models_ids, value=models_ids[-1]),
|
49 |
],
|
50 |
+
outputs=[
|
51 |
+
gr.Image(type="pil"),
|
52 |
+
gr.Textbox(interactive=False),
|
53 |
+
],
|
54 |
examples=examples,
|
55 |
cache_examples=True if examples else False,
|
56 |
).launch(enable_queue=True)
|