banner

News

Oct 14, 2024

How to Get Started with the Raspberry Pi AI Camera | Tom's Hardware

77% Person, 22% Junk Food, 1% Unknown

When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works.

Raspberry Pi’s new AI Camera Kit takes the strain of processing neural network models from the CPU; instead the Sony IMX500 does all of the hard work. Yes, the $70 Raspberry Pi AI Camera Kit has just been released and we had early access to a unit for our review, but we wanted to show you how to get started with the kit, and this will be the first in a short series of how tos, covering getting started and how to generate your own neural network models for use with the kit.

In this part, we get things up and running, learn how to use the software from the terminal, and via Python. We’ll be using a Raspberry Pi 5 for the how to, but the process can be repeated on a Raspberry Pi 4 or Zero 2 W. Note that other models of Pi may need a few tweaks to work.

For this project you will need

Our first step is to get the hardware installed, luckily this is really easy to do.

Raspberry Pi OS has a series of camera applications that can be used for quick camera projects, or in this case, to test that the camera is working properly. The first is raspi-hello, the “hello world” of camera testing. We’re going to use it with a never-ending timer (-t 0s) and the mobilenet object detection model.

If we would like to use pose estimation, then we need to modify the command to use the posenet model.

To record the session as a ten-second video, use raspicam-vid to output an MP4 file. This will save the video, along with the bounding boxes and recognized objects.

Get Tom's Hardware's best news and in-depth reviews, straight to your inbox.

Picamera2 is the Python module that can be used to control the plethora of Raspberry Pi cameras, and now it has support for the new AI Camera. But before we can use it, we need to install some software dependencies.

We can also use the pose estimation demo to check that Python can detect a human pose.

The documentation does reference creating your own neural network models, but Sony’s Brain Builder for AITRIOS is not ready yet, and we were unable to convert a Tensorflow model created in Microsoft Lobe, for use in the imx500 converter suite of tools. We’ll be keeping an eye on this, and once the tool is ready, an additional how to will cover how to train your own neural network model for use with the Raspberry Pi AI Camera.

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

This Raspberry Pi Pelican cyberdeck is ready for hack-tion

Jeff Geerling finally unlocks Raspberry Pi external GPU support, and yes it runs Doom... 3 at 4K!

SilverStone’s $799 Alta D1 chassis hits retail — modular workstation case is flexible and capacious at 79 liters

For this project you will needCarefully unlock the camera’s plastic clips and insert the wider end of the camera cable so that the metal “teeth” are visible from the front of the camera.Lock the cable into place.With the power turned off, unlock the plastic clip on CAM1 (CAMERA on Pi4) connector. Insert the other end of the camera cable into the connector with the metal pins facing the USB / Ethernet port on the Pi.Check that the cable is level, and carefully lock into place.Power up the Raspberry Pi Open a terminalInstall the software package for the Sony IMX500 used in the Raspberry Pi AI Camera.Reboot the Raspberry PiOpen a terminal and enter this command, followed by the Enter key.Hold objects to the camera to test.If the focus is off, either move the object into focus, or, adjust the focus When you are done testing, close the window to end.Open a terminal and enter this command, followed by the Enter key.Stand in front of the camera,Move around!Close the window to end.Open a terminal window and use this command to record the video to a file called output.mp4.Press Enter to run the codeVia the File Manager, navigate to the file and open using VLC.Open a terminal and run this command.Download the Picamera2 GitHub repository to the home directory of your Raspberry Pi.Navigate to picamera2/examples/imx500.Using Python, open imx500_object_detection_demo.pyIn the preview window, watch as the AI camera attempts to identify objects presented to the camera.Close the window to exit.Navigate to picamera2/examples/imx500.Using Python, open imx500_pose_estimation_higherhrnet_demo.py.Pose for the camera.Close the window to exit.
SHARE