Getting Started with the Raspberry Pi AI Camera - Sony IMX500
- Daniela Brenes
- Sep 17
- 4 min read
Updated: Sep 23

What is the Raspberry Pi AI Camera?
The Raspberry Pi AI Camera is a cutting-edge device powered by Sony’s IMX500 Intelligent Vision Sensor. Its built-in AI processor makes it easy to run and deploy neural network models, providing inference results directly from the camera. This leaves the Raspberry Pi compute-free for other general tasks like multimedia handling, UI and real time interaction with the user.

The Raspberry Pi AI Camera can run AI models for a variety of tasks, including:
Image classification
Object detection
Semantic segmentation
Pose estimation
In this tutorial, we will guide you through the process of setting up the Raspberry Pi AI Camera and running real-time inference with an object detection model.
Setting Up the Raspberry Pi AI Camera
1. Gather your components
To follow this tutorial you will need the following components:
A Raspberry Pi device
A keyboard and a mouse

2. Set up the Raspberry Pi
Follow the instructions in the official Raspberry Pi getting started guide to get the Raspberry Pi board up and running.
3. Install the Raspberry Pi AI Camera
Carefully connect the Raspberry Pi AI Camera to your Raspberry Pi board by following the official installation guide.
4. Install the IMX500 Firmware
The following instructions apply to the Raspberry Pi 4 Model B and Raspberry Pi 5. If you are using a different model, you may need to adjust the steps slightly.
Update the Raspberry Pi to the latest software:
Install the IMX500 firmware files:
After running the previous command, the necessary files and tools to run the IMX500 will be installed:
Neural network model firmware files from the Raspberry Pi AI Camera Model Zoo are saved in /usr/share/imx500-models/
Firmware files for the IMX 500 sensor operation are located at /lib/firmware/imx500_loader.fpk and /lib/firmware/imx500_firmware.fpk
Sony network model packaging tools are also installed in the system.
4. Reboot the Raspberry Pi
Before running a model with the Raspberry Pi AI Camera, reboot the Raspberry Pi device.
5. Verify that the Raspberry Pi AI Camera is recognized
Run the following command to list the available cameras on the Raspberry Pi. If the Raspberry Pi AI Camera is correctly recognized, your output should be similar to ours.
Running Real-Time Object Detection with the Raspberry Pi AI Camera
You can interact with the Raspberry Pi AI Camera and run real-time inference using Python libraries. Two popular options are Picamera2 and the Application Module Library, which make it easy to build and run AI applications directly on the Raspberry Pi AI Camera.
We will show you how to use both to run real-time object detection with the SSD MobileNetV2 FPN Lite model.
Using Picamera2 with Raspberry Pi AI Camera
Picamera2 is a Python interface to Raspberry Pi’s camera software stack. Read the official Picamera2 manual to learn more about it.
1. Installation
As of September 2022, Picamera2 comes pre-installed with Raspberry Pi OS, but not with Raspberry Pi OS Lite. Note that it is only supported on Raspberry Pi OS Bullseye or newer.
In the case where Picamera2 is supported but not previously installed:
Picamera2 can also be installed via pip, although the apt alternative is recommended since it guarantees that compatible versions of Picamera2 and libcamera will be installed together.
The Picamera2 examples rely on OpenCV for drawing on the frame buffer:
2. Download the examples
Clone the Picamera2 repository:
Travel to the AI camera examples directory:
3. Run real-time object detection
Run the object detection example with the SSD MobileNetV2 FPN Lite model:
Afterwards, you should see a window similar to the following, and observe real-time object detection on your camera!

If you face permission errors when attempting to run the example, check out the troubleshooting section at the end of this guide.
Using Application Module Library with Raspberry Pi AI Camera
Application Module Library, or modlib, is an SDK by Sony with the goal to simplify the usage of the Raspberry Pi AI Camera and facilitate the development of applications for it.
1. Download the examples
Clone the modlib repository:
2. Run real-time object detection
modlib is provided as a Python project managed with uv. You can install uv by following our UV Tutorial.
Run the object detection example with the SSD MobileNetV2 FPN Lite model:
Just like the previous examples, a window should appear and you should be able to see the Raspberry Pi AI Camera detecting objects within its view.

If you face permission errors when attempting to run the example, check out the troubleshooting section at the end of this guide.
Hooray! We just ran real-time object detection on the AI Camera using two different Python libraries: Picamera2 and modlib. We encourage you to explore both of these options, and choose the most appropriate for your use case.
If you need to install modlib for your projects, you can do so with:
Troubleshooting Common Issues with the Raspberry Pi AI Camera
If you run into permission errors while running the Raspberry Pi AI Camera models, such as:
You may need to adjust the permissions for the debug filesystem. The following command allows all users to access /sys/kernel/debug. Note that this change is temporary and will reset after a reboot.
Contact Us
At RidgeRun.ai, we specialize in edge AI solutions, including projects with the Raspberry Pi AI Camera on resource-constrained systems. If you need help bringing your AI or computer vision project to life, contact us at contactus@ridgerun.ai — let’s collaborate!
