วันพฤหัสบดีที่ 25 มกราคม พ.ศ. 2567

Raspberry pi5 TensorFlow-lite Object Detection

Raspberry pi5 TensorFlow-lite Object Detection

Hardware : Raspberry pi5

Specification
  • Broadcom BCM2712 2.4GHz quad-core 64-bit Arm Cortex-A76 CPU, with cryptography extensions, 512KB per-core L2 caches and a 2MB shared L3 cache
  • VideoCore VII GPU, supporting OpenGL ES 3.1, Vulkan 1.2
  • Dual 4Kp60 HDMI® display output with HDR support
  • 4Kp60 HEVC decoder
  • LPDDR4X-4267 SDRAM (4GB and 8GB SKUs available at launch)
  • Dual-band 802.11ac Wi-Fi®
  • Bluetooth 5.0 / Bluetooth Low Energy (BLE)
  • microSD card slot, with support for high-speed SDR104 mode
  • 2 × USB 3.0 ports, supporting simultaneous 5Gbps operation
  • 2 × USB 2.0 ports
  • Gigabit Ethernet, with PoE+ support (requires separate PoE+ HAT)
  • 2 × 4-lane MIPI camera/display transceivers
  • PCIe 2.0 x1 interface for fast peripherals (requires separate M.2 HAT or other adapter)
  • 5V/5A DC power via USB-C, with Power Delivery support
  • Raspberry Pi standard 40-pin header
  • Real-time clock (RTC), powered from external battery
  • Power button


Software 

Raspberry pi OS : 64 bit 

tflite-support


The new Raspberry Pi OS uses Python 3.11 by default, but TensorFlow Lite currently only supports Python 3.9 on ARM aarch64 architecture. To resolve this, you can create a separate virtual environment with Python 3.8 or 3.9 using

conda create -n name python=3.8 or conda create -n name python=3.9


Conda Python 3.8

Install mini conda

https://docs.conda.io/projects/miniconda/en/latest/miniconda-other-installer-links.html


conda create -n tflite python=3.8.18
conda activate tflite


TensorFlow-lite Example


Install Code

git clone https://github.com/tensorflow/examples --depth 1
cd examples/lite/examples/object_detection/raspberry_pi
sh setup.sh

Run Image Object Detection


Run Video File Object Detection


Source Code

https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/raspberry_pi










Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan

วันอังคารที่ 16 มกราคม พ.ศ. 2567

Raspberry pi5 Yolov8 Object Detection

 Raspberry pi5 Yolov8 Object Detection


YOLOv8 from Ultralytics

Ultralytics YOLOv8 is a cutting-edge, state-of-the-art (SOTA) model that builds upon the success of previous YOLO versions and introduces new features and improvements to further boost performance and flexibility. YOLOv8 is designed to be fast, accurate, and easy to use, making it an excellent choice for a wide range of object detection and tracking, instance segmentation, image classification and pose estimation tasks.

Raspberry pi 5

Specification
  • Broadcom BCM2712 2.4GHz quad-core 64-bit Arm Cortex-A76 CPU, with cryptography extensions, 512KB per-core L2 caches and a 2MB shared L3 cache
  • VideoCore VII GPU, supporting OpenGL ES 3.1, Vulkan 1.2
  • Dual 4Kp60 HDMI® display output with HDR support
  • 4Kp60 HEVC decoder
  • LPDDR4X-4267 SDRAM (4GB and 8GB SKUs available at launch)
  • Dual-band 802.11ac Wi-Fi®
  • Bluetooth 5.0 / Bluetooth Low Energy (BLE)
  • microSD card slot, with support for high-speed SDR104 mode
  • 2 × USB 3.0 ports, supporting simultaneous 5Gbps operation
  • 2 × USB 2.0 ports
  • Gigabit Ethernet, with PoE+ support (requires separate PoE+ HAT)
  • 2 × 4-lane MIPI camera/display transceivers
  • PCIe 2.0 x1 interface for fast peripherals (requires separate M.2 HAT or other adapter)
  • 5V/5A DC power via USB-C, with Power Delivery support
  • Raspberry Pi standard 40-pin header
  • Real-time clock (RTC), powered from external battery
  • Power button

Raspberry Pi 3, 4, and 5 compare

FeatureRaspberry Pi 3Raspberry Pi 4Raspberry Pi 5
CPU1.2GHz Quad-Core ARM Cortex-A531.5GHz Quad-core 64-bit ARM Cortex-A722.4GHz Quad-core 64-bit Arm Cortex-A76
RAM1GB LPDDR22GB, 4GB or 8GB LPDDR4Details not yet available
USB Ports4 x USB 2.02 x USB 2.0, 2 x USB 3.02 x USB 3.0, 2 x USB 2.0
NetworkEthernet & Wi-Fi 802.11nGigabit Ethernet & Wi-Fi 802.11acGigabit Ethernet with PoE+ support, Dual-band 802.11ac Wi-Fi®
PerformanceSlower, may require lighter YOLO modelsFaster, can run complex YOLO modelsDetails not yet available
Power Requirement2.5A power supply3.0A USB-C power supplyDetails not yet available
Official DocumentationLinkLinkLink

Raspberry pi OS


Install Library

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

PyPI version Downloads

pip install ultralytics

Run Test Image with Command Line

YOLOv8 may be used directly in the Command Line Interface (CLI) with a yolo command:

yolo predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'



Run Video File

yolo predict model=yolov8n.pt source=/home/pi/Video/your_video.mp4 show=True










Reference

Quick Start Guide: Raspberry Pi and Pi Camera with YOLOv5 and YOLOv8

https://docs.ultralytics.com/guides/raspberry-pi/#choose-your-yolo-version-yolov5-or-yolov8








Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan




วันอาทิตย์ที่ 4 กันยายน พ.ศ. 2565

Raspberry pi YOLOv4 Object Detection with Intel Neural compute stick and OpenVINO

Raspberry pi YOLOv4 Object Detection 

with Intel (Neural compute stick) and OpenVINO


This is implementation of YOLOV4,YOLOV4-relu,YOLOV4-tiny ,YOLOV4-tiny-3l ,Scaled-YOLOv4 in OpenVINO2021.3 on Raspberry pi.

Last Article. If you want to use YOLOv3

http://raspberrypi4u.blogspot.com/2022/08/raspberrypi-yolo-objectdetection.html


Hardware · Raspberry Pi Board (4B ) · Intel Neural Compute Stick 2 · SD Card 32GB · 5V DC. 2A Power Supply Software · OS Raspbian 10 ( Buster ) · Python 3.7.3 · OpenVINO Toolkit 2021.3 ( 2021.3.0-2787-60059f2c755-releases/2021/3 ) · OpenCV 4.0.0

YOLOv4

With the original authors work on YOLO coming to a standstill, YOLOv4 was released by Alexey Bochoknovskiy, Chien-Yao Wang, and Hong-Yuan Mark Liao. The paper was titled YOLOv4: Optimal Speed and Accuracy of Object Detection

Author: Alexey BochoknovskiyChien-Yao Wang, and Hong-Yuan Mark Liao
Released: 23 April 2020


Run Python Code on YOLOv4


Run Python Code on YOLOv4-tiny


Compare Performance ( YOLOv4 vs. YOLOv4-tiny )




 





Compare YOLOv4-tiny with Raspberry pi + Intel NCS vs. NVIDIA Jetson Nano



Performance Compare



Reference


Source Code

Raspberry pi YOLOv3 Object detection 

Raspberry pi OpenVINO with Intel Movidius ( Neural Compute Stick )


Install OpenVINO™ toolkit for Raspbian* OS https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_raspbian.html


Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan




วันอังคารที่ 2 สิงหาคม พ.ศ. 2565

Raspberry pi YOLO Object detection with Intel Neural compute stick and OpenVINO

Raspberry pi YOLO Object detection with Intel Neural compute stick and OpenVINO 

Hardware · Raspberry Pi Board (4B ) · Intel Neural Compute Stick 2 · SD Card 32GB · 5V DC. 2A Power Supply Software · OS Raspbian 10 ( Buster ) · Python 3.7.3 · OpenVINO Toolkit 2020.3 · OpenCV 4.0.0

What is a YOLO object detector?

When it comes to deep learning-based object detection, there are three primary object detectors you’ll encounter:

  • R-CNN and their variants, including the original R-CNN, Fast R- CNN, and Faster R-CNN
  • Single Shot Detector (SSDs)
  • YOLO
First introduced in 2015 by Redmon et al., their paper, You Only Look Once: Unified, Real-Time Object Detection, details an object detector capable of super real-time object detection, obtaining 45 FPS on a GPU.

You Only Look Once: Unified, Real-Time Object Detection

https://arxiv.org/pdf/1506.02640v3.pdf


YOLOv3 improved on the YOLOv2 paper and both Joseph Redmon and Ali Farhadi, the original authors, contributed.
Together they published YOLOv3: An Incremental Improvement

The original YOLO papers were are hosted here

Author: Joseph Redmon and Ali Farhadi
Released: 8 Apr 2018

We’ll be using YOLOv3 in this blog post, in particular, YOLO trained on the COCO dataset.

The COCO dataset consists of 80 labels.

YOLOv3-416


Video Inference Performance    3 FPS.




YOLOv3-tiny-416


Video Inference Performance    7 FPS.




Compare Performance



Reference

Raspberry pi OpenVINO with Intel Movidius ( Neural Compute Stick )


Install OpenVINO™ toolkit for Raspbian* OS https://docs.openvino.ai/latest/openvino_docs_install_guides_installing_openvino_raspbian.html


Adun Nantakaew อดุลย์ นันทะแก้ว 081-6452400
LINE : adunnan