Це відео не доступне.
Перепрошуємо.
Raspberry Pi LESSON 63: Object Detection on Raspberry Pi Using Tensorflow Lite
Вставка
- Опубліковано 24 тра 2023
- UPDATE:
If you are getting an error like:
ImportError: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ~/.local/lib/python3.9/site-packages/tensorflow_lite_support/metadata/cc/python/_pywrap_metadata_version.so)
you need to be on the same version of software that I am of tflite_support. Downgrade yours from version 0.4.4 (current) to 0.4.3 (used in this tutorial)using this command:
python -m pip install --upgrade tflite-support==0.4.3
Check out gear here:
amzn.to/3JWH7vp
If you are able, I suggest you consider getting some spare servos for the pan tilt hat. During development if you are not careful, it is possible to damage a servo by crashing the camera into something. I like to keep a couple spares on hand:
amzn.to/3E1KZaN
Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!
In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)
amzn.to/3tSk9Mo
or for our UK friends, amzn.to/3I5d401
In today's video I will show you how install tensorflow lite on the Raspberry Pi. I will show how to use tensor flow to perform object detection from both a webcam and a pi camera. We will complete the program and by the end of the lesson you will have object detection working on a raspberry pi.
If you want to grab those cool little straight jumper wires I am using to keep my breadboard builds neat and clean you can snag a box of them here:
amzn.to/36NyfHq
If you guys are interested in the oscilloscope I am using, you can pick one up here (affiliate link):
amzn.to/3v13Mhl
You guys get your hardware ordered so you can follow along at home!
You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:
amzn.to/3pBMfKm
The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:
amzn.to/3KcXTn2
I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi. We demonstrate this by using a button switch to control a LED.
amzn.to/36Rv9Sk
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
#tensorflow
#objectdetection
#raspberrypi
UPDATE:
If you are getting an error like:
ImportError: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ~/.local/lib/python3.9/site-packages/tensorflow_lite_support/metadata/cc/python/_pywrap_metadata_version.so)
you need to be on the same version of software that I am of tflite_support. Downgrade yours from version 0.4.4 (current) to 0.4.3 (used in this tutorial)using this command:
python -m pip install --upgrade tflite-support==0.4.3
This should fix things.
Спасибо, это сильно мне помогло!
it shows -u no such option
Thank you.
Thanks!
double dash for ''- - upgrade ''
Your patience in producing theses videos with all the intricate instructions is amazing. Many of the other online video tutorials skip over details and leave students wondering how to get from step to step. With my Pi camera and 8 max_results I see 8 FPS. Keep up the great work Paul!
Easy to understand. Beautiful programming. Thanks Paul.❤❤❤
Excellent educational piece, enjoyed following the development.
Nothing to say sir.. It's the ultimate🙏❤... Your patience and nature of teaching are going better day by day.
Thats was really helpful sir 🙏 .. thanks for this session 👍
AS usual you produced a most excellent video! Hope you arrive home safe and healthy!
WoW. I was frustrated just to setup opencv couple of weeks back before stumbling upon your videos. And now I have a working tensor flow setup detecting multiple objects. All thanks to your masterclasses. Thanks Paul.
Great to hear!
Important note for people taking this course from 2024!
Viewer:
1. I cannot stress how important it is to do the homework, which is to install a 64-bit version of Bullseye OS on your Pi on a new micro SD card. If you try running this lesson on another OS it is likely to not work.
2. Test the code every time Mr. Paul does. It will save you frustration. For example, I found that this project requires numpy 1.x. I am a novice so it took me a while to figure out, but you can troubleshoot if you test along with Paul.
Thanks Mr. Paul! As a person with limited coding and math experience, you are the best.
Спасибо, я раньше работал с нейросетями, и сначала мне было очень сложно, потому что сложно было найти хорошее объяснение, теперь же один знакомый рассказал мне про твой канал, и честно сказать я восхищён тем как ты объясняешь, все становится понятным и простым, спасибо, это очень круто!
Excellent. Now we talking. I really like TensorFlow, I tried YOLOv8 before on my Raspberry Pi4 but I only got 1.8 FPS. With the same setup as you I run 8 FPS both with Picamera2 and webcam. I hope you are going to produce a lot of TensorFlow lessons in the future. Btw, you are the best teacher on UA-cam. (Today I also bought a Coral Edge accelerator, will be fun to test and see the FPS)
May I know how you did It?
Hey man! I am also facing the same problem. The FPS using YOLOv8 is very low. Can you please share your code/ resources you used to write your code?
how did you use coral usb with the same code.just making "True" doesnot solve the issue.I have also installed the libraries related to coral
Thanks Paul!
Thanks Paul. I had a rough go from the beginning with all my mistakes, But every mistake I learned something from my past problems. I love this stuff.
you are funny, love your coffee receipt!!!
cool stuff Paul.
Thank you sir ! It worked perfectly ! If anyone had the error with GLIBCXX_3.4.29 while testing the code, all you have to do is run the command : python -m pip install --upgrade tflite-support==0.4.2 (downgrade from 0.4.4)
I have this in my pi4 b I love it it really is cool ❤awesome video! I also have opencv and visual studio code .
I really thank you very much for taking the time and making these videos, and for sharing your knowledge with us, long live to you my good friend, greetings from Guatemala!
The coral option is cool.....I have a coral try one .
Bro i saw you in my dreams i met you and i was asking you python question about open cv i think you were my teacher i wish i can met you in real life you help me i lot you are great
brilliant, thank-you.
Great video. Did you figure out why the picamera had such a low FPS?
Thank you Paul for your amazing tutorials. Quick question: is there any way to extract values from the "detections" object? values such as category, bounding box coordinated, etc. You hinted at this topic at the end of your video but I'm not sure if there is another tutorial on TensorFlow.
Thank you.
working great at 9 fps on pi 4! Thank you Paul-! supercool and fun
Great to hear!
The Orange Pi5 is running this code about 2-3 times faster than the RP4. The OPi5 8 cores are around 50% at 48 C degrees. 800 x 600 = 20 FPS 1280 x 720 = 10 FPS 🐬 Cheers.
Also, if the print statements are removed the FPS will increase a little. A most fun project. 🥰
Hey can you plzzz help?
I'm trying this code from last 1 month on Rpi 5 but it keeps giving me "subprocess exited with error" , whenever I try to execute sh setup.sh, can you help plzzz?
this guy is my holy grail
Hi someone know how to transform the thinks the raspberry find to audio??
My master ❤🌹🌺
Hello! If I want the system to print the name of the detected object, what command would you suggest? Thank you for the video by the way!!
Please I want to run Yolov7 or 8 on my raspberry pi please can you help me on that?
Thanks in advance
how can I fix attributeError module cv2.cv2 has no attribute CAP_PROP_FRAME_FPS?
My Webcam does not show a picture, I get the window that pops up. How do I fix error message, cv2.error opencv(4.5.3) - 206 bad flag?
Hey , sir i just wana know how to limit the number of objects being detected say for example i just want one object to be detected , is there a file where in i can change this i.e, the name of the classes i am unable to find one . can u help me with it
Hi, I have been following your videos in the past months or so, first thank you for the great tutorials, it has been an amazing ride up until here. in this lesson, when I try to do what you did in 41:00 I get an error saying this "ValueError: The model is not a valid flatbuffer buffer"
I have gone through everything I could find online but nothing worked, I have check what was installing on your Pi and checked the versions to my own, everything is the same as yours, but I get this error, I am using this for a university project and the deadline is closing in on me, any help would be great.
thank you in advance (sorry if my English seems a little off, it's not my native language)
Hey Paul,
i am facing problems as soon as i connect the USB webcam. If i run the script without connecting the USB webcam it runs normaly and i can interrupt the program with the key 'q'. Running the script with the USB webcam connected shows the frames but it freezes the mouse and keyboard. im not able to quit the script as long as the USB webcam is connected.
I did a little search and found it "sudo setpci -s 01:00.0 0xD4.B=0x41" as Bugfix. But it didn't worked for me. The same occurs if i try to run the script with the USB webcam. Frames are shown but keyboard and mouse freeze.
Could you please give a hint? Thx.
how to add coral usb part in this tutorialJust making the statement "True" doesnot work
hello sir, my terminal report like this "libmmal.so: cannot open share object file" can you help me fix it, thanks
Is the source code available anywhere? I am having trouble trying to listen to the video and typing the code into an editor?
Love the way you cover the topics.
I have a question . I do what you do step by step and all of that work but the camera module raspberry it not working what's the problème
I did this lesson on a RPI 3B (on the same SD-card as all the other lessons)
I only changed the frame size to 640x360
fps: 3
How to change the color of the text showing the objects? The red color is difficult to read.
That will be the whole point of the next lesson. We will not use the tensorflow utilities for drawing the annotations but will crack open the data structure and build our own boxes and annotations.
@@paulmcwhorter Thanks Paul. 😊
How cai i do with my custom data
What version of tflite u have used sir
This dude can detect kids on his lawn from over 20 feet away!
Is this model detect banana, orange, onion, potato, garlic?
Hi Paul, I have been following your tutorials and have learned a lot of basic stuffs I missed in the past. I am currently upgrade my Pi to Bookworm (Debian 12). The legacy camera option is no longer available and Python is changed to version 11. The installation of tflite requires to down grade python to 3.9. After install 3.9 and create a virtual environment including system-site-package, I was able to install tflite and ran the example using the webcam by specify the cameraId to 1 using only cv2. When I try to implement picamera2 using CSI camera, I got an error of "module picamera2 not installed". I tried to install it using pip in the virtual environment but failed. I wonder if you have the same experience and have a way of resolving it? Thanks! Thomas
Hi Thomas, i am a newbie and i can't install python 3.9 whatever i do, do you have any video/link to follow through?
Hi, thx for this very good tutorial and thx for your perfect english, making it easy for understanding your explanations for non native speakers. All works fine. However has anyone already used the example with the USB Coral Edge TPU to run? Only the option set to TRUE does not work. I couldn't find anything on the web about the error message. I have already replaced the model, but I fear you have to install the Edge TPU runtime according to the Coral website, which I'm afraid will destroy the current installation, so it would be nice to get some information about the pitfalls beforehand. Thanks in advance!
I could solve it :-)
@@peterdemharter5834 hi can you help me please. I am facing same problem
how to use it in custom dataset?
Did you find a solution for this?!!
@@mahmoudsholak1967me too, i trained on gg colab, but it fail. Can you?
I love your lessons, but you missed the fact that your apt-get update failed because your pi doesn't appear to be on the network looking at the top right of the screen. So the subsequent apt-get upgrade was of course extremely fast :-)
Hi, I am facing these type of error
Traceback (most recent call last):
File "/home/pi/Python/detect.py", line 40, in
detector=vision.ObjectDetector.create_from_options(options)
File "/home/pi/.local/lib/python3.9/site-packages/tensorflow_lite_support/python/task/vision/object_detector.py", line 87, in create_from_options
detector = _CppObjectDetector.create_from_options(
RuntimeError: Unable to open file at efficientdet_lite0.tflite
I need your help.. How I resolve the error..
Hey sir,,, I'm trying this code from last 1 month on Rpi 5 but it keeps giving me "subprocess exited with error" , whenever I try to execute sh setup.sh, can you help plzzz?
you have to use python 3.7.3 (same version as Paul). python 3.11 did not work for me so i had to downgrade python
Is it okay if I have only one Picamera, without the Webcamera?
Should work for most things
@@paulmcwhorter yeah it's functioning very well. Thank you sir
Hi sir. If I want to detect only human, then what I should do. Could you please help me Mr. Paul ? :)
Here is the link to my homework. ua-cam.com/video/jliXH07wZtw/v-deo.html
LEGEND!
@@paulmcwhorter Thanks, this one was really fun.
July 2023 and running into the same problem with this as every other time I've been trying to do tflite stuff...
ImportError: /lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by ~/.local/lib/python3.9/site-packages/tensorflow_lite_support/metadata/cc/python/_pywrap_metadata_version.so)
tflite looks to be using a glibc version not currently available on the standard pi builds.
Same problem here since few days.
I've tried fresh install of Bullseye even without updating and it is still the same so something must have changed in tensorflow
Facing the same problem.Let me know if you guys find any solution
I got this same problem
@@tanvirarnob49, @mchamster7
I've found solution:
In short downgrade tflite_support from version 0.4.4 (current) to 0.4.3 (used in this tutorial)using this command:
python -m pip install --upgrade tflite-support==0.4.3