examples icon indicating copy to clipboard operation
examples copied to clipboard

Updated lite/examples/object_detection/raspberry_pi/utils.py and changed requirements.txt

Open abhaymathur21 opened this issue 2 years ago • 1 comments

I tried running the object detection example provided in the examples library of tensorflow lite but it gave me an error (Error 1) that I could not solve no matter what and I found out that the tflite-support 0.4.4 version was deprecated and did not work on raspberry pi 4 b so I downgraded it to 0.4.0

Error 1 (from above paragraph): image

But when i did that it still gave me an error (Error 2) so i traced the error back all the way to the utils.py file in the same folder and figured out what the problem was in the code.

Error 2 (from paragraph above): image

Problem was as follows:

Incorrect variable names were used in the utils.py file in lite/examples/object_detection/raspberry_pi I changed line 48 from "category = detection.categories[0]" to "category = detection.classes[0]" and line 49 from "category_name = category.category_name" to "category_name = category.class_name"

After making these changes the code worked perfectly on my raspberry pi 4 b

abhaymathur21 avatar Sep 11 '23 13:09 abhaymathur21

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Sep 11 '23 13:09 google-cla[bot]