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 boxes with very low confidence. #58

Closed roofuskit closed 1 year ago

roofuskit commented 4 years ago

I'm getting a lot of bounding boxes, a LOT. Many of them are often very low confidence. Is there any way to correct this? photo5064402415427627057

photo5064402415427627051

photo5060054018738464947

photo5060054018738464946

robmarkcole commented 2 years ago

You can filter them on confidence before displaying

sstratoti commented 1 year ago

Looking the code in https://github.com/robmarkcole/coral-pi-rest-server/blob/master/coral-app.py on line 56 you set an explicit threshold of 0.4. However we're getting back scores that are below that in the results?

With deepstack, you can set the minimum confidence through the API call https://docs.deepstack.cc/object-detection/index.html#setting-minimum-confidence

If we're trying to emulate an endpoint, would it be possible to add this in as a parameter in the request?

Not as familiar with flask, but I could muddle my way through and submit a PR if needed. I think the main issue is that its returning values above the threshold to begin with.

robmarkcole commented 1 year ago

Possibly the confidences are in %, so 0.4% is too low. Just a guess, been a long time since I worked on this

sstratoti commented 1 year ago

Sorry, thought I had posted an update! I found a dockerfile for building a docker container of your project, but it was using v1.0 of the code. Whatever version I was using had a confidence level set of .05, or 5% - which pretty much returns everything.

So once I updated (and made some changes for the PR I submitted, which I'll make the edits and will re-commit like you asked), it worked fine. I'm wondering if this user was also using this older version of the code.

I'm still seeing smaller and inaccurate boxes, but at least the confidence is being honored. I'm going to try compiling pycoral locally and see if I get the same issue. It might be that I'm using an older version. Then possibly figure out how to compile for the docker container itself.

sstratoti commented 1 year ago

Yup - never hit the comment button in my browser.

So like I was saying, I'm having an issue with the bounding boxes similar to #62 - for some reason I don't think they're scaling correctly for me. I think I may be using an older version of pycoral in my docker container...not sure how to check which version. Going to try running it locally first to confirm its still an issue, and then try to figure out the docker container bit.