element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Blog Using an RPi Camera Module 3 with the RPi5 AI Kit
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 29 Sep 2024 2:55 AM Date Created
  • Views 5079 views
  • Likes 12 likes
  • Comments 2 comments
Related
Recommended
  • picamera2
  • rpi camera module 3
  • rpi5
  • hailo-8l
  • rpi ai kit
  • rpicam

Using an RPi Camera Module 3 with the RPi5 AI Kit

ralphjy
ralphjy
29 Sep 2024

I recently purchased an RPi5 AI Kit from Sparkfun.  They had been out of stock for a while but are currently available at multiple distributors.  The kit bundles the M.2 HAT+ with a Hailo-8L AI acceleration module.  The kit comes pre-assembled with the module mounted with a thermal interface on the M.2 HAT+.  It comes with the required standoffs to mount it on an RPi5 with an active cooler.

I've previously used the Intel Neural Stick 2 and Google Coral USB accelerators with RPi4s.  Those units claim to operate at 4 TOPS and the Hailo-8L is listed at 13 TOPS.  I am currently using the Coral setup to run Frigate on Home Assistant OS.

The AI Kit shown mounted on an RPi5.

image

Here is my assembly with an 8GB RPi5 and RPi Camera Module 3.

image

A side view shows the clearance between the top of the active cooler heatsink and the bottom of the HAT+.  I had to buy a slightly taller case to fit the assembly.

image

Mario Bergeron wrote a blog earlier Accelerating the MediaPipe models on Raspberry Pi 5 AI Kit demonstrating hand landmark detection using the AI Kit with a webcam using MediaPipe models.  He has benchmarking data included.

I tried out his example but initially could only achieve a 15 fps inferencing rate.  I was using an older Logitech C525 720p webcam and when I switched to a newer eMeet C980 1080p webcam I was able to achieve the same 30 fps rate in his example.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Next, I wanted to try out the AI Kit with the RPi Camera Module 3.  I've been impressed by the quantity and quality of the documentation and software examples that are already available for the AI Kit.

 

Hailo's github repo

https://github.com/hailo-ai/hailo-rpi5-examples.  

This repository contains examples of basic pipelines for Hailo's RPi5 platform. The Python examples demonstrate object detection, human pose estimation, and instance segmentation.  The examples can be run using a USB camera by default (/dev/video0). You can change the input source using the --input flag. To run with a Raspberry Pi camera, use --input rpi.  To run with a video file, use --input (e.g.) resources/detection0.mp4.

The object detection example uses the yolov6n model as default. It supports also yolov8s and yolox_s_leaky models.

python3 basic_pipelines/detection.py --input rpi -f

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

The human pose estimation example uses the yolov8s_pose model.

python3 basic_pipelines/pose_estimation.py --input rpi -f

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

The instance segmentation example uses the yolov5n_seg model.

python3 basic_pipelines/instance_segmentation.py --input rpi -f

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Raspberry Pi Official Examples

rpicam-apps

https://github.com/raspberrypi/rpicam-apps

The latest rpicam-apps include hailo post-processing JSON examples in the assets folder of the rpicam-apps repository.

The following examples are included:

hailo_classifier.json
hailo_yolov5_personface.json
hailo_yolov5_segmentation.json
hailo_yolov6_inference.json
hailo_yolov8_inference.json
hailo_yolov8_pose.json
hailo_yolox_inference.json

The following examples are inferencing at 640x640 resolution but streaming at higher resolution.

hailo_yolo6_inference

rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov6_inference.json --lores-width 640 --lores-height 640

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

hailo_yolov5_personface

rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov5_personface.json --lores-width 640 --lores-height 640

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

hailo_yolov8_pose

rpicam-hello -t 0 --post-process-file ~/rpicam-apps/assets/hailo_yolov8_pose.json --lores-width 640 --lores-height 640

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

picamera2

The picamera2  python library has also been updated to include hailo.

Running the detect and pose examples from the ~/picamera2/examples/hailo/ directory:

python3 detect.py

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

python3 pose.py

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image


Summary

The existing Hailo and RPi official examples were straightforward to set up and ran without issues.  The installation and use documentation is very good.

I currently use a Coral accelerator with an RPi4 to run object detection on real-time ip camera video streams using Frigate.  Hailo indicates that Frigate integration is coming soon and I'm really looking forward to trying that out.

In the meantime, I'm going to look through their tutorials and try retraining and developing my own models and also take a better look at the work Mario has done.  And maybe try some benchmarking.

I noticed that the Hailo 8 which runs at 26 TOPS is available at somewhat over $200.  If that doesn't get scarce maybe I'll get one of those to try.

  • Sign in to reply
  • DAB
    DAB 9 months ago

    Nice post, the system appears quite responsive.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren 9 months ago

    Very interesting.  It seems that the detection is pretty solid.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube