Spaces:
Runtime error
Runtime error
giangvinhloc610
commited on
Commit
·
86887eb
1
Parent(s):
71559fc
Final JSON output
Browse files
app.py
CHANGED
|
@@ -36,7 +36,7 @@ def predict(image, threshold=0.25, model_id=None):
|
|
| 36 |
numpy_image = results.render()[0]
|
| 37 |
output_image = Image.fromarray(numpy_image)
|
| 38 |
|
| 39 |
-
return (output_image, results.pandas().xyxy[0].to_json())
|
| 40 |
|
| 41 |
|
| 42 |
gr.Interface(
|
|
@@ -51,7 +51,7 @@ gr.Interface(
|
|
| 51 |
],
|
| 52 |
outputs=[
|
| 53 |
gr.Image(type="pil"),
|
| 54 |
-
|
| 55 |
],
|
| 56 |
examples=examples,
|
| 57 |
cache_examples=True if examples else False,
|
|
|
|
| 36 |
numpy_image = results.render()[0]
|
| 37 |
output_image = Image.fromarray(numpy_image)
|
| 38 |
|
| 39 |
+
return (output_image, results.pandas().xyxy[0].to_json(orient='records'))
|
| 40 |
|
| 41 |
|
| 42 |
gr.Interface(
|
|
|
|
| 51 |
],
|
| 52 |
outputs=[
|
| 53 |
gr.Image(type="pil"),
|
| 54 |
+
gr.outputs.Textbox(label="JSON"),
|
| 55 |
],
|
| 56 |
examples=examples,
|
| 57 |
cache_examples=True if examples else False,
|