Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abhaymathur21
Copy link

@abhaymathur21 abhaymathur21 commented Sep 11, 2023

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

The tflite-support 0.4.4 version was deprecated and so the example did not work on Raspberry Pi 4b
Replaced categories with classes
and category_name with class_name
@google-ml-butler google-ml-butler bot added the size:XS CL Change Size: Extra Small label Sep 11, 2023
@google-cla
Copy link

google-cla bot commented Sep 11, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review size:XS CL Change Size: Extra Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants