Object detection with Raspberry Pi and Python

Object detection with Raspberry Pi and PythonQuantumBlockedUnblockFollowFollowingNov 26Today we will discuss how to build a simple and cheap mobile object detector. The purpose of this research is to determine if an object detection model on a cheap mobile device can be used for real-world tasks.As a mobile platform, we use a Raspberry Pi 3 Model B..This structure makes it easy for you to expand the storage and switch between different operating systems by swapping out microSD cards.Raspberry Pi 3As the hardware part of our object detector, we used a Raspberry Pi 3 Model B and a Raspberry Pi Camera V2..We also need a microSD card, with at least 16 Gb of memory because building OpenCV can be a very memory hungry procedure.Raspberry Pi with camera module V2Object Detection ModelsFor our experiment, we had chosen the following models: tiny YOLO and SSD MobileNet lite.You only look once (YOLO) is a state-of-the-art, real-time object detection system implemented on Darknet..The remaining boxes are passed through a “non-max suppression” that will eliminate possible duplicate detections and thus only leave the most precise of them (image on the right).YOLOSSD (Single Shot MultiBox Detector) is a popular algorithm in object detection..SSD with MobileNet is, an object detection model optimized for inference on mobile devices.The key idea here is a single network (for speed) and no need for region proposals..Different bounding box predictions are achieved by each of the last few layers of the network responsible for predictions for progressively smaller bounding box and final prediction is a union of all these predictions.SSDFor object detection, we used OpencCV, Tensorflow Object Detection API and Darkflow..To avoid building Darknet on a Raspberry Pi we used Darkflow is Darknet translation to run over TensorFlow..Also, we used YOLO’s pretrained weights tiny-yolo-voc.weights from authors of Darkflow (https://drive.google.com/drive/folders/0B1tW_VtY7onidEwyQ2FtQVplWEU) and network config tiny-yolo-voc.cfg from the Darkflow source repository.Now, we need to download the MobileNet SSDLite model from the TensorFlow detection model zoo..The model zoo is Google’s collection of pre-trained object detection models that have various levels of processing speed and accuracy..And visualize results:SummaryWe ran both models and got these results: — YOLO tiny — 0.32 FPS; — SSD MobileNet Light — 1.07 FPS.So looking at these results we can state that we can use a mobile detector with SSD MobileNet for real-life simple pedestrian tracking or for house security systems, that can detect cats on your lawn.. More details

Leave a Reply