วันพุธที่ 13 กรกฎาคม พ.ศ. 2565

Raspberry pi 4 Object Detection with TensorFlow and TensorFlow lite

Raspberry pi 4B Object Detection with TensorFlow and Tensorflow Lite Comparison













What is object detection?

Given an image or a video stream, an object detection model can identify which of a known set of objects might be present and provide information about their positions within the image.

An object detection model is trained to detect the presence and location of multiple classes of objects. For example, a model might be trained with images that contain various pieces of fruit, along with a label that specifies the class of fruit they represent (e.g. an apple, a banana, or a strawberry), and data specifying where each object appears in the image.

When we subsequently provide an image to the model, it will output a list of the objects it detects, the location of a bounding box that contains each object, and a score that indicates the confidence that detection was correct.

Object Detection Models

We use MobileNet-v2 Model.

Run Object Detection Model on Raspberry pi 4B


TensorFlow

Software • Raspberry pi Legacy OS ( Raspbian 10 , 32 bit version ) • Tensorflow 1.14.0 • OpenCV 4.0 • Python 3.7.3 Machine Learning Model : SSD Mobilenet V2 ( FP32 )

Image JPG 1024x636 pixels

Video MP4 960x540 pixels

Result ( Image )


Loading time 8327.86 ms             @ test1

Inference time 10245.02 ms


Loading time: 7910.86 ms            @ test2

Inference time: 9650.78 ms


Loading time: 7917.60 ms            @ test3

Inference time: 9642.02 ms


Result ( Video )    ~ 2 fps



TensorFlow-lite

 
Result ( image )


Loading time: 4.13 ms            @ test1

Inference time: 229.85 ms


Loading time: 4.38 ms            @ test2

Inference time: 231.55 ms


Result ( Video )    ~ 4-5 fps



TensorFlow and TensorFlow-lite Comparison















Reference

TensorFlow

https://www.tensorflow.org/

https://github.com/tensorflow/models


TensorFlow-lite

https://github.com/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi


Website : https://softpower.tech

ไม่มีความคิดเห็น:

แสดงความคิดเห็น