How to Perform Object Detection with TensorFlow Lite on Raspberry Pi | Digi-Key Electronics

  Рет қаралды 33,296

DigiKey

DigiKey

Күн бұрын

In this tutorial, Shawn walks you through installing TensorFlow Lite on a Raspberry Pi and using it to perform object detection.
COCO SSD MobileNet V1 and labels (ZIP file): storage.google...
Code for this tutorial can be found in the written tutorial here: www.digikey.co...
Code is based on EdjeElectronics’ TensorFlow Lite demo project: github.com/Edj...
Object detection is the process of having a computer look at an image, figure out which objects are in that image, and then classify them. It’s a difficult problem in the field of computer vision, but neural networks have made object detection possible on even low-powered computers, like the Raspberry Pi.
TensorFlow Lite is a stripped-down version of TensorFlow that is optimized for speed and low memory. It is only capable of performing inference with a model, so don’t expect to use it for training. In the video, we’ll install TensorFlow Lite and OpenCV on a Raspberry Pi.
Rather than train our own model, we’ll use a pre-trained model that can be downloaded from one of Google’s TensorFlow tutorials. The model is MobileNet v1, which has been configured for single shot multibox detection (SSD) on the Common Objects in Context (COCO) dataset. An SSD model gives us a list of objects it thinks it sees in an image along with a predicted bounding box for each object. The “single shot” aspect refers to the fact that we can get all of this information by performing inference only once.
The COCO dataset is a popular set of around 200,000 images that have been labeled with around 90 object categories by researchers at Google, Facebook, and various universities. A model that has been pre-trained with the COCO dataset should be capable of identifying objects of those categories. While it’s often not the most accurate (as we discover in the video), it can work as a great starting point for SSD object detection.
We can use transfer learning to tweak the parameters in a pre-trained network to detect objects of our choosing. This process requires collecting data and re-training part of the model, which we will cover in a future episode.
Product Links:
Raspberry Pi 3B+ - www.digikey.co...
Raspberry Pi 4 (4 GB) - www.digikey.co...
Raspberry Pi 4 (8 GB) - www.digikey.co...
Raspberry Pi Camera Module V2 - www.digikey.co...
Related Videos:
What is Edge AI?
• Intro to Edge AI: Mach...
Intro to TensorFlow Lite Part 1: Wake Word Feature Extraction
• Intro to TensorFlow Li...
Intro to TensorFlow Lite Part 2: Speech Recognition Model Training
• Intro to TensorFlow Li...
Intro to TensorFlow Lite Part 3: Speech Recognition on Raspberry Pi
• Intro to TensorFlow Li...
Related Project Links:
How to Perform Object Detection with TensorFlow Lite on Raspberry Pi - www.digikey.co...
Related Articles:
What is Edge AI? - www.digikey.co...
TensorFlow Lite Tutorial Part 1: Wake Word Feature Extraction - www.digikey.co...
TensorFlow Lite Tutorial Part 2: Speech Recognition Model Training - www.digikey.co...
TensorFlow Lite Tutorial Part 3: Speech Recognition on Raspberry Pi - www.digikey.co...

Пікірлер: 65
@aisolutions834
@aisolutions834 3 жыл бұрын
Nice work Shawn!, I just finished this project, was a really great experience as a new Pi member! I've done some transfer learning for my project, but I think everybody likes to see your take on transfer learning on Pi4 and ESP32!
@sugumarp3454
@sugumarp3454 3 жыл бұрын
Crisp and clear. Good content.
@LouisFox89
@LouisFox89 3 жыл бұрын
Such an incredibly well made interesting video. Really good and useful.
@vedantpoddar2309
@vedantpoddar2309 4 жыл бұрын
Love your videos❤️!! Keep them coming!
@gabrielcassoni9514
@gabrielcassoni9514 4 жыл бұрын
This video is exactly what I was looking for! Thank you!
@tanjiro3285
@tanjiro3285 11 ай бұрын
90 % digikey ytb channel is shawn 😁
@gautamnarayan2617
@gautamnarayan2617 2 жыл бұрын
Thank you for the video. I have a small question. How can we detect a particular object for the label map? Is there a way to do it? I just want to detect people from the list. Thank you in advance!!
@markpretorius6854
@markpretorius6854 3 жыл бұрын
Great job, please keep making videos
@amirmahdisoltani1
@amirmahdisoltani1 4 жыл бұрын
Fantastic ... I really learn from you ...
@jasondeglint
@jasondeglint 3 жыл бұрын
This is great content! More like this please. :)
@newsonsports7457
@newsonsports7457 2 жыл бұрын
I want to detect custom object ..what will be the changes.which file replace?
@amritraj7640
@amritraj7640 2 жыл бұрын
Can we use it for only detecting a specific object ?
@mayurbhat9479
@mayurbhat9479 3 жыл бұрын
Thanks, Great Video!! Since the objects are detected, can you show how to convert it to speech in raspberry pi?
@amnahrafie1435
@amnahrafie1435 3 жыл бұрын
Thank you for the very informative video, I have a small question due to an error that appears while running the python code that opens the RPI camera. The error stated: Didn't find op for builtin opcode 'CONV_2D' version '5'. Any idea on how to solve this error? The code is given in the tutorial runs with no error it's just the command prompt in the RPI that shows the error I mentioned earlier.
@michaelhofmann5091
@michaelhofmann5091 3 жыл бұрын
Hey man great stuff I got stuck at 4:03" , My command promp sais "could not find a version that satisfies the requirement opencv-contrib-python=4.1.0.25. N matching disptribution found for opencv-contrib-python==4.1.0.25. Am I missing something here or should I type in a diferent Version? Cheers!
@911Kano
@911Kano Жыл бұрын
Same issue. Please help!
@michaelhofmann5091
@michaelhofmann5091 Жыл бұрын
@@911Kano got no help since
@MuhammadDaudkhanTV100
@MuhammadDaudkhanTV100 4 жыл бұрын
Cool project
@faisalali5864
@faisalali5864 4 жыл бұрын
❤ the tutorial, Can u provide information to run this model of tensorflow lite on sipeed M1n or on android phone.
@harshita8600
@harshita8600 3 жыл бұрын
Hey .Unable to sign- in into Google account(gmail account) on raspberry Pi 4.... Plz help...
@tiarakusumadewi2337
@tiarakusumadewi2337 3 жыл бұрын
Hi Sir. I have succeeds to follow your tutorial. Thanks to you. However, after a while, when re-try to run the code, the object detector web does not pop up.
@donnguyen4956
@donnguyen4956 3 жыл бұрын
even though TensorFlow make the program lightweight to fit on a single board computer, can the Program be optimize any futher (in term of memory, and computational power), in order to be operational on something like ESP32?
@sqribe
@sqribe 11 ай бұрын
the script works fine when running on a usb web cam, but when i use the camera module from amazon (has the night vision /ir switching, i read somewhere it's modelled after the official v1 module.) anyway, when i use it with that camera, nothing happens. a little 'preview' box shows up empty and i get an error about frame1.copy returning a Nonetype, indicating it's not pulling info off the camera, however, libcamera-hello gives me a crisp clear picture of myself, so i know the camera functions. anyone out there have any advice?
@ahedmafarjeh936
@ahedmafarjeh936 2 жыл бұрын
tank you i have an question. please,can you tell me how i can use yolo model instead of ssd mobilenet?
@lernenmitrobin
@lernenmitrobin 4 жыл бұрын
great as usual!
@YigalBZ
@YigalBZ 3 жыл бұрын
Thank you! one problem: at 04:30, there is no such table of WHL files in the link. Perhaps it was changed? Help please.
@YigalBZ
@YigalBZ 3 жыл бұрын
Found a link to the list. But when I run it, the following error occurred: ""Could not install packages due to an EnvironmentError: 404 client error: Not found for url pypi.org/simple/tflite-runtime
@YigalBZ
@YigalBZ 3 жыл бұрын
After copying from the picture the path you provided (and not the one in the site) - I managed to pass this step
@ichibankasuga5787
@ichibankasuga5787 3 жыл бұрын
@@YigalBZ Not for me (( still getting "tflite_runtime-2.1.0.post1-cp37-cp37m-linux-armv7l-linux_armv7l.whl is not a supported wheel on this platform" on Pi 3+....
@mohammedkedir1591
@mohammedkedir1591 3 жыл бұрын
This video is really helpful great job! But I was trying to download opencv 4.1.0.25 but it starts then it stops when it gets 92% then the error is update the hashe do you have any idea about that thanks!
@WTFhowdIdie
@WTFhowdIdie 2 жыл бұрын
Hello, I am trying to follow this build and I encounter an error at 10:12 in the video. When I try to execute the script, I get: Traceback (most recent call last): File "TFLite_detection_webcam.py", line 19, in import cv2 File "/home/pi/Projects/Python/tflite/tflite-env/lib/python3.7/site-packages/cv2/__init__.py", line 3, in from .cv2 import * ImportError: libjasper.so.1: cannot open shared object file: No such file or directory ________________________________________ I've followed the video exactly and started with a fresh build. If anyone could help me out I'd really appreciate it.
@KD_edit_bt
@KD_edit_bt 3 жыл бұрын
Failed to fetch error sudo apt -y install qt4-dev-tools libatlas-base-dev libhdf5-103
@deepeshdeepakdd2
@deepeshdeepakdd2 3 жыл бұрын
Can you guide on as to how to stream this Tensorflow object detection video feed to Windows/Ubuntu which is connected to the same WiFi network as the RPi.
@yaribnevarez2541
@yaribnevarez2541 3 жыл бұрын
Thanks again!
@haseenabegum6153
@haseenabegum6153 3 жыл бұрын
Sir can you please tell me How activate the tflite environment automatically without typing the commands and can u please tell me how te get speech output of the objects detected
@jellianjanenegrite8503
@jellianjanenegrite8503 3 жыл бұрын
There's an error in last program in TFlite_detection_webcam.py --modeldir=coco_ssd_mobilenet_V1, it say's the following arguments are required: --modeldir. Can you help me about this? Thank You!
@ninaddeshmukh654
@ninaddeshmukh654 3 жыл бұрын
I am facing the same problem did you got any solution for it if so do lmk
@ikhwalsyukur2068
@ikhwalsyukur2068 3 жыл бұрын
Anyone know how to fix it? I have problem in last code when u want to show camera, The error write like this "TFLite_detection_webcam.py", line 102, in "ModuleNotFoundError: No Module named 'tensorflow'
@timothyruston1801
@timothyruston1801 3 жыл бұрын
I think that means you have not installed tensorflow correctly
@carlosdanielruizsaucedo8685
@carlosdanielruizsaucedo8685 3 жыл бұрын
tengo el mismo error
@aynonsense7716
@aynonsense7716 Жыл бұрын
Can tflite model run on raspberry pi 2?
@terryterry1655
@terryterry1655 2 жыл бұрын
Tensorflow running at? Fps
@jean-marckapisu7512
@jean-marckapisu7512 3 жыл бұрын
Hello everyone, I'm a beginner, at 1:53 how to save the .bashrc ?
@akeemlouigarde4946
@akeemlouigarde4946 3 жыл бұрын
It's saying "unable to locate package libjasper-dev"
@jameshodds8800
@jameshodds8800 2 жыл бұрын
I have the same problem did you ever sort this out if so how
@projectideas6543
@projectideas6543 3 жыл бұрын
Help! No module named cv2
@saadmunawar7920
@saadmunawar7920 3 жыл бұрын
im getting the same error, idk what to do about it
@projectideas6543
@projectideas6543 3 жыл бұрын
@@saadmunawar7920 I got it resolved, go back to the steps you might miss something that you type or copy-pasted.
@Tony770jr
@Tony770jr 4 жыл бұрын
We'll, more like alphabet soup than object detection.
@JohnGalanakis
@JohnGalanakis 3 жыл бұрын
FUCKING TENSORFLOW CHANGED THEIR SITE AND I CANT SEEM TO FIND OLDER VERSIONS BESIDE 2.5.0 PLEASE FUCKING HELP ME :'(
@texasdaveodell
@texasdaveodell 3 жыл бұрын
sudo apt -y install qt4-dev-tools libatlas-base-dev libhdf5-103
@KD_edit_bt
@KD_edit_bt 3 жыл бұрын
it is not working and give error
@KD_edit_bt
@KD_edit_bt 3 жыл бұрын
@Shawn Hymel please se into it
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 23 МЛН
1 сквиш тебе или 2 другому? 😌 #шортс #виола
00:36
когда не обедаешь в школе // EVA mash
00:51
EVA mash
Рет қаралды 4,2 МЛН
Tensorflow Lite with Object Detection on Raspberry Pi!
11:31
Lazy Tech
Рет қаралды 25 М.
Build a smart IoT device with TensorFlow Lite and Raspberry Pi
16:57
How To Run TensorFlow Lite on Raspberry Pi for Object Detection
10:48
Edje Electronics
Рет қаралды 874 М.
Pi Shortage - Are These Worthwhile Raspberry Pi Alternatives?
20:50
Michael Klements
Рет қаралды 192 М.
My Daughter's Dumplings Are Filled With Coins #funny #cute #comedy
00:18
Funny daughter's daily life
Рет қаралды 23 МЛН