Short summary:
In this article, I will explain how to create a solution for object detection on Raspberry Pi 4 (4 GB) from Pi-camera in live time.
I will use pre-trained model.
Code for this article is available here.
Note before you start:
So, Let’s start :)
Hardware preparation:
Software preparation:
For run this application just run the next commands:
1 download this repo to your raspberry pi
sudo git clone https://github.com/tensorflow/examples --depth 1
2 go to this repo
cd examples/lite/examples/object_detection/raspberry_pi
3 prepare Object Detection folder && upload Object detection pretrained model and unzip
# The script takes an argument specifying where you want to save the model files
bash download.sh /tmp
4 preparing VNC (if you have)
If you go to VNC Server Options (right-click on the VNC status icon in the top right) and check to Enable direct capture mode on the Troubleshooting page. This will allow you to see the camera output via VNC. Like on the screenshots:
5 run script which will show images from Pi camera
python3 detect_picamera.py \
--model /tmp/detect.tflite \
--labels /tmp/coco_labels.txt
Result:
So in this article, we created simple recognition object detection in the live time. Code from this article is here.