robmarkcole / coral-pi-rest-server

Perform inferencing of tensorflow-lite models on an RPi with acceleration from Coral USB stick
https://coral.ai/products/accelerator
MIT License
67 stars 20 forks source link

Bounding box computation seems wrong #5

Closed lmamakos closed 5 years ago

lmamakos commented 5 years ago

I made this change:

--- coral-app.py.original   2019-06-07 00:07:28.942209359 -0400
+++ coral-app.py    2019-06-07 00:22:49.023841467 -0400
@@ -83,8 +83,8 @@

                     bounding_box = {
                         "x1": round(prediction.bounding_box[0, 0], DECIMALS),
-                        "x2": round(prediction.bounding_box[0, 1], DECIMALS),
-                        "y1": round(prediction.bounding_box[1, 0], DECIMALS),
+                        "x2": round(prediction.bounding_box[1, 0], DECIMALS),
+                        "y1": round(prediction.bounding_box[0, 1], DECIMALS),
                         "y2": round(prediction.bounding_box[1, 1], DECIMALS),
                     }
                     preds.append(

and now the bounding boxes seem to line up better..

robmarkcole commented 5 years ago

@lmamakos can you share a couple of examples? Thanks

lmamakos commented 5 years ago

I was using the jupyter notebook over in the other repo https://github.com/robmarkcole/HASS-Google-Coral/blob/master/development/general-objects.ipynb and at that very last step near "Need to fix" I noticed that the bounding boxes on that people_car.jpg image were funky..

Let me run though that again with my modified server and maybe use that to demonstrate the effect of the change.

lmamakos commented 5 years ago

When I do run through that jupyter notebook with my modified flask server, I get nicely rendered bounding boxes around the objects; 2019-06-12_21-25-54

robmarkcole commented 5 years ago

OK I had made a typo, should be fixed now, can you try out https://github.com/robmarkcole/coral-pi-rest-server/releases/tag/v0.3 ? Cheers