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 & Partners
    Products & Partners
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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 & Partners
  • More
Raspberry Pi
Blog Detecting Objects with the RASPBERRY Pi AI Camera and a RASPBERRY Pi 5 -- Version 1
  • 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: RobinB13
  • Date Created: 7 Nov 2026 11:26 AM Date Created
  • Views 40 views
  • Likes 1 like
  • Comments 2 comments
Related
Recommended
  • raspberry pi
  • ai camera

Detecting Objects with the RASPBERRY Pi AI Camera and a RASPBERRY Pi 5 -- Version 1

RobinB13
RobinB13
7 Nov 2026

As an intern for the element14 community, I carried out this project as part of the tasks I had during my internship. The idea is simple: use a Raspberry Pi 5 and a Raspberry Pi AI Camera to recognize everyday objects, and build the project in four steps so that each one adds a single new feature to the previous one.
Here is the progression. First, version 1: I set up the camera and print the objects it detects in the terminal. Second, version 2: I take a photo and save it, together with a copy annotated with the detected objects. Third, version 3: I run detection on a live video stream. Fourth, version 4: I'll try to make the video stream reachable from another PC.

What Hardware and Software I used

To get this project going, I used a Raspberry Pi 5 8GB (RAM is optional but try to get one >= 8GB, even with nowadays RAM price inflation >:(...) with its dedicated Active Cooler, and a Raspberry Pi AI Camera, with its sensor called IMX500. What makes this camera special is that it runs its neural network (the model that recognize objects) on the camera itself, not on the Pi's processor, it receives only the images and the results.

You'll also need some storage, like a microSD card not less than 32GB, to carry out the OS and potential pictures taken (if you get to this step Smiley). To power up all this, the official PSU from Raspberry Pi works perfectly, and to avoid using your beloved monitor and unplug it from your beautiful PC setup, a Touch Display 2 7" will do the job wonderfully. 

image

The model used in every version is the file /usr/share/imx500-models/imx500_network_ssd_mobilenetv2_fpnlite_320x320_pp.rpk. From its name, it is an SSD MobileNetV2 FPNLite model with a 320x320 input. The .rpk extension is the packaged format loaded onto the camera ==> I didn’t just pull that out of the hat; you'll see how I did it in a minute!

From the import lines of my files, the Python libraries involved are picamera2 (camera control), libcamera, numpy, Pillow (image saving and drawing, step2) and openCV (cv2, live display, step3). The live window of step3 also needs a desktop session on the Pi.

Version 1 - Setup the environment and the camera

Goal: Check that the camera works and that it can detect objects, printed as text in the terminal

**You can read through that link on how to configure your Raspberry Pi**

First of all: it is needed to ask the Pi if any updates are available, and install everything we'll need onto it: the different python packages mentioned earlier, as well as the imx500 resources.

imageimage

Once those have been installed, a well deserved REBOOT is needed for our Pi. Then to keep it in the momentum and not let it cool down, lets see how we can get the model quoted higher:  

  • First, to see if the AI Camera is detected, the command rpicam-hello --list-camera is perfectly well designed, and we search through the imx500 directory(tab key will be your best friend):

image

And we can see at the end of the list our model! Lovely!

Then we need to load the model into the camera, start the video stream and decode the results. A python source file is in charge of that, which I named... Detector.py. Not very original I reckon... :P

It has a function named read(), that returns one video frame and a list of detections:

image
A detection is a small Detection object holding a label, a confidence conf and a bounding box. The confidence is the model's certainty, from 0 to 1. Detections with a score at or below the threshold are ignored.

The test script hello_detect.py then simply calls read() from Detector.py in a loop and prints in the terminal what it finds using the Objects.txt file (labels list):

image

The defaults are a threshold of 0.55 and a duration of 15 seconds, both adjustable with --threshold and --duration in the main python file named  hello_detect.py

Now, lets try to launch the main python file to see if anything works: 

image

And... it works! As you can see at the end of the output, the camera detected a person standing in front of it. Was it me? Maybe... :P

As mentioned earlier, I showcase the arguments I created in hello_detect.py by using --duration, setting the time capture for this demo at 3 seconds.

Difficulty encountered / that may happen

Those are basics but really time wasting and frustrating: 

  • Camera not detected? Take a look at your connections to the Pi (:

  • One that really got me on my nerves is microSD card being on read-only after a re-write. I started on a different Pi, first OS write has been successful on the first try. Once I got the one Pi that I ordered, I told myself that I'll start from the beginning again! Well... I don't know how, but when I wanted to re-write on the SAME microSD card, I couldn't, which took me fairly one hour to understand why... 

Conclusion

And that's it for the version 1 of this project! I've set up the AI Camera, loaded an object-detection model, and confirmed that detections appear in the terminal. It's a simple first step, but it lays the foundations for the version 2: Taking a photo and saving an annotated copy with the detected objects marked on it.

  • Sign in to reply
  • Qbit
    Qbit 1 hour ago

    Cool Project RobinB13 ! 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur 3 hours ago

    Nice project.

    • 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube