I've been using CodeProject AI with Mike Lud's license plate model on Blue Iris for a couple years now, but in this setup, the ALPR doesn't really do a whole lot. Really, you have more of a license plate camera with some OCR as a bonus, and no nice way to take advantage the data other than parsing Blue Iris logs or paying $600+/year for PlateMinder or Rekor ALPR.
This project serves as a complement to a CodeProject Blue Iris setup, giving you a full-featured database to store and actually use your ALPR data, completely for free. Complete with the following it has a very solid initial feature set and is a huge upgrade over the standard setup.
- Searchable database & fuzzy search
- Build labeled training sets from your traffic
- Live recognition feed
- Traffic Analytics
- Categorization and filtering
- Store information on known vehicles
- Push notifications
- Automation rules
- Customizable tagging
- Configurable retention
- Flexible API
- HomeAssistant integration
- Permissioned users
The application is packaged as a Docker image. This is the fastest and most reliable way to deploy. Below is a done-for-you installation script that will create a Docker stack with both the application and a PostgreSQL database. The installation script is recommended and more carefully maintained, but manual installation instructions are also available here.
You will need the following installed on your system.
- Docker
- Docker Compose
- Docker engine enabled and running
Tip
If unfamiliar with Docker, an easy way to check all three of these boxes at once is to install Docker Desktop, which has a GUI and bunch of nice tools.
Create a new directory wherever you would like to store your ALPR data. Enter the directory in your terminal and paste in the below command. After that, everything will be set up automatically!
curl -sSL https://raw.githubusercontent.com/algertc/ALPR-Database/main/install.sh | bash
Or, if you prefer:
wget -qO- https://raw.githubusercontent.com/algertc/ALPR-Database/main/install.sh | bash
If your user is not in the Docker group, you will need to run with sudo using the command below:
curl -sSL https://raw.githubusercontent.com/algertc/ALPR-Database/main/install.sh | sudo bash
Create a new directory wherever you would like to store your ALPR data. Open PowerShell with administrator priveleges and cd into your new install directory.
Paste in the below commands. After that, everything will be set up automatically!
Set-ExecutionPolicy RemoteSigned
irm https://raw.githubusercontent.com/algertc/ALPR-Database/main/install.ps1 | iex
To start sending data, log in to the application and navigate to settings -> security in the bottom left hand corner. At the bottom of the page you should see an API key. Click the eye to reveal the key and copy it down for use in Blue Iris.
ALPR recognitions are sent to the api/plate-reads
endpoint.
We can make use of the built-in macros to dynamically get the alert data and send it as our payload. It should look like this:
{ "plate_number":"&PLATE", "Image":"&ALERT_JPEG", "camera":"&CAM", "ALERT_PATH": "&ALERT_PATH", "ALERT_CLIP": "&ALERT_CLIP", "timestamp":"&ALERT_TIME" }
Set your API key with the x-api-key header as seen below.
Note: The &PLATE macro will only send one plate number per alert. If you need to detect multiple plates in a single alert/image, you can optionally use the memo instead of the plate number. Your payload should look like this:
{ "memo":"&MEMO", "Image":"&ALERT_JPEG", "camera":"&CAM", "timestamp":"&ALERT_TIME" }
This is meant to be a helpful hobby project and is still a work-in-progress. There's a good amount of spaghetti code in here and random things left over from the initial release. Not to be relied on for anything critical.