In this project, I'll show you how to transform a Raspberry Pi paired with an AI Camera into an automatic parking monitoring system by installing and modifying a sample application and object detection model.
Here's how it works: You define specific parking zones within the camera's field of view, and the system uses an object detection model to identify vehicles in real-time. When a vehicle enters one of your predefined parking zones, the system automatically marks that space as occupied.
The steps are:
- Installation: Get your hardware and software set up.
- Define parking spaces: Define your parking spaces visually.
- Run the application: Bring it all together for live monitoring.
The script streams frames from the camera, performs object detection (car, bus, truck), tracks these detections through time, and overlays colored annotations on the video.
Each parking space is represented by a polygon loaded from a JSON file.
For every frame:
- If a vehicle intersects a polygon → mark the space red (occupied)
- Otherwise → mark it green (free)
Open a terminal window.
Run the following command to clone the application repository:
git clone git@github.com:SonySemiconductorSolutions/aitrios-rpi-sample-apps.gitRun the applicationNavigate to the parking monitor directory:
cd aitrios-rpi-sample-apps/examples/parking-monitor/Run the following command to start the parking monitor sample app:
uv run app.pyThis installs the dependencies automatically and starts the real-time parking monitor.
Defining parking spacesThis application requires a configuration JSON file that specifies the coordinates of parking spaces, usually as polygons or rectangles.
A configuration tool has been integrated into this application to simplify the process of specifying a custom area. To activate this tool, simply click the middle mouse button. This will overlay flat squares/buttons on the screen that allow the user to select actions.
To begin, it is recommended to define either polygons or simple rectangles over the parking spaces. Once this is done, click "Save" and close the configuration menu by clicking "Close."
The newly defined shapes will be active immediately.
More information about the configuration tool can be found on this link.
About this applicationAI modelThis project uses a NanoDet object detection model optimized to run on the IMX500 chip in the AI Camera.
You can download a pre-trained and converted, ready to use, model from the Raspberry Pi Model Zoo.
Key features- Real-time analysis: detects and monitors parking space occupancy in real-time.
- Visual feedback: Live video feed with bounding-box overlays showing detected vehicles.
- Smart detection: Automatically distinguishes free and occupied parking spaces.
- Edge AI processing: Detection is done on the AI Camera for fast and power efficient operation.
Keep these points in mind as you build your system:
- This application only supports 4-point polygons to define parking spaces.
- If you move or adjust your camera, you'll need to redefine your parking zones using the selector tool.
- The first time you upload a new model to the AI Camera, expect a wait of several minutes.
Some suggestions for your next steps:
- Export the results over MQTT.
- Use a map provider to display free spots on a map.
- Integrate the results with a navigation service to help drivers find a free slot.
If you have questions related to Raspberry Pi, please check and utilize the forum below:
Want to learn moreExperiment further with the Raspberry Pi AI Camera by following the Get Started guide on the AITRIOS developer site.
Code






Comments