giangvinhloc610
commited on
Commit
•
0d436fd
1
Parent(s):
86887eb
Remove image display, to better support my esp32
Browse files
app.py
CHANGED
@@ -35,8 +35,10 @@ def predict(image, threshold=0.25, model_id=None):
|
|
35 |
|
36 |
numpy_image = results.render()[0]
|
37 |
output_image = Image.fromarray(numpy_image)
|
38 |
-
|
39 |
-
|
|
|
|
|
40 |
|
41 |
|
42 |
gr.Interface(
|
@@ -50,7 +52,7 @@ gr.Interface(
|
|
50 |
gr.Dropdown(models_ids, value=models_ids[-1]),
|
51 |
],
|
52 |
outputs=[
|
53 |
-
gr.Image(type="pil"),
|
54 |
gr.outputs.Textbox(label="JSON"),
|
55 |
],
|
56 |
examples=examples,
|
|
|
35 |
|
36 |
numpy_image = results.render()[0]
|
37 |
output_image = Image.fromarray(numpy_image)
|
38 |
+
|
39 |
+
# I have to parse this on my ESP32, so I don't need to display the image (which will increase the packet's size and reduce processing speed)
|
40 |
+
#return (output_image, results.pandas().xyxy[0].to_json(orient='records'))
|
41 |
+
return results.pandas().xyxy[0].to_json(orient='records')
|
42 |
|
43 |
|
44 |
gr.Interface(
|
|
|
52 |
gr.Dropdown(models_ids, value=models_ids[-1]),
|
53 |
],
|
54 |
outputs=[
|
55 |
+
#gr.Image(type="pil"),
|
56 |
gr.outputs.Textbox(label="JSON"),
|
57 |
],
|
58 |
examples=examples,
|