Full ALPR Database System for Blue Iris!

@algertc
Also having API Key randomly changing.

Edit: When navigating the ALPR webpage, the page will sign me out and send me back to the login page. When I log back in, the Key is changed.
 
Last edited:
Sorry for the delay on this. I just pushed a new image that should fix it for now. I'm going to try to improve the way it works to make it more robust soon.

If it doesn't work right away, try deleting the auth.json file and restarting and it should at that point.


Update script that runs checks to ensure everything looks right then automatically does the update coming with the next additions... Hoping that will streamline things.
 
Sorry for the delay on this. I just pushed a new image that should fix it for now. I'm going to try to improve the way it works to make it more robust soon.

If it doesn't work right away, try deleting the auth.json file and restarting and it should at that point.


Update script that runs checks to ensure everything looks right then automatically does the update coming with the next additions... Hoping that will streamline things.
Indeed working without issues now. I saw on GitHub that the temporary fix was already quite complex, and you're planning to enhance it even further. Huge thanks, Charlie, for your hard work!
 
  • Like
Reactions: MikeLud1
Pardon the dumb questions, but what other prerequisites need to be installed/enabled/configured before running this? This is my first time using AI anything, so a lot of obvious steps for you will not be obvious for me :D. So far I've done the following:
  1. Followed the instructions from the ReadMe.md, including:
    1. Including manually creating /auth, /config, and /storage directories
    2. Created docker-compose.yml with my desired passwords
    3. Downloaded schema.sql and migrations.sql
    4. Ran
      Code:
      docker compose up -d
  2. Realized I needed to have some AI installed first :facepalm:, so I:
    1. Went to BI 5.9.924's AI tab and clicked the Code Project logo to download and install CPAI, which is now running:
      1. 1738280332897.png
    2. From the AI dashboard, installed Mike Lud's LPR module and YOLO v5.NET, which is recommended because I have no discrete GPU nor Coral TPU. Both are Green:
      1. 1738280180891.png
    3. Configured Web Requests for my 3 LPR cameras:
      1. 1738280301756.png
    4. Refreshed APLR with:
      1. Code:
        docker compose down
      2. Code:
        docker compose pull
      3. Code:
        docker compose up -d
      4. and something is now running, but I have no activity:
      5. 1738280464364.png
      6. Double-checked that my API key hasn't changed:
      7. 1738280568808.png
So I think I have all the pieces installed, but I'm not getting anything in the ALPR database, so I think the pieces aren't talking to each other. Did I miss a step? Thanks!

p.s. all components are currently running on the same machine, in case that wasn't clear.
 
From the CPAI dash, I see there are 0 jobs executed, which might mean BI is not sending any detection requests to CPAI.

What do you have on the camera Alert tab?

1738281367751.png
 
  • Like
Reactions: TheWaterbug
^^ Thanks! I don't understand (yet) what any of that means, but now my 3 camera Alert tabs look like yours. We'll see if I start getting any data.

Is there a diagram somewhere that shows the workflow of BI with AI and associated other modules like ALPR? I don't understand the data flows.
 
I'm pretty new to BI also, but based on what I've learned, I think it goes like this:

BI trigger (motion detection) > Alert/Confirm with AI > CPAI > ALPR module > BI Alert confirmed > ALPR DB

If your LPR camera can be aimed at a license plate, you can manually trigger an alert in BI and watch the flow. You can confirm that CPAI is getting the request for object detection by look at the dash board for increasing counter of executions.
 
  • Like
Reactions: MikeLud1
Is there a diagram somewhere that shows the workflow of BI with AI and associated other modules like ALPR? I don't understand the data flows.
Below is the workflow
  1. BI detects motion and sends image to the ALPR module
  2. The ALPR module uses the Object Detection module (license plate model) to detect if a license plate is in the image. If no license plate is found in the image the ALPR module returns a JSON that no plates were detected.
  3. If a license plate is detected the ALPR module crops the license plate and runs PaddleOCR on the cropped plate.
  4. The ALPR module returns to BI a JSON of the results.
  5. If BI confirms the Alert it sends the alert image, plate, and camera to the ALPR-Database for record keeping.
 
From the CPAI dash, I see there are 0 jobs executed, which might mean BI is not sending any detection requests to CPAI.
Progress! I now have jobs being executed:

1738297195787.png


but they're all 'No objects found' followed by 'No plates found'. I'm guessing that's the order of operations because the last two entries in the log are in that order.

The ALPR database is empty.

I'm still tuning the camera nighttime settings, but I figured I'd get at least a couple of hits after hundreds of jobs, especially since a few of those alerts were me, putting my car in the driveways and adjusting the focus and exposure.

So I'm guessing I still have something misconfigured. Is there another place to look for logs to see what's not happening? Thanks!
 
Below is the workflow
  1. BI detects motion and sends image to the ALPR module
  2. The ALPR module uses the Object Detection module (license plate model) to detect if a license plate is in the image. If no license plate is found in the image the ALPR module returns a JSON that no plates were detected.
  3. If a license plate is detected the ALPR module crops the license plate and runs PaddleOCR on the cropped plate.
  4. The ALPR module returns to BI a JSON of the results.
  5. If BI confirms the Alert it sends the alert image, plate, and camera to the ALPR-Database for record keeping.
Fascinating! I would not have guessed that the LP detection was a completely separate operation from the OCR!
 
I'm still tuning the camera nighttime settings, but I figured I'd get at least a couple of hits after hundreds of jobs, especially since a few of those alerts were me, putting my car in the driveways and adjusting the focus and exposure.

So I'm guessing I still have something misconfigured. Is there another place to look for logs to see what's not happening? Thanks!
This generated a camera alert, and my plate looks pretty clear here:

1738298287076.png


Here's a 100% crop:

1738298312852.png


and the server log for 19:08:00 shows:

Code:
19:03:26:Response rec'd from License Plate Reader command 'alpr' (...2b70a2) ['No plates found']  took 1639ms
19:08:01:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...4a6809) ['No objects found']  took 371ms
19:08:01:Response rec'd from License Plate Reader command 'alpr' (...e60e44) ['No plates found']  took 385ms
19:08:01:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...b2f698) ['No objects found']  took 500ms
19:08:01:Response rec'd from License Plate Reader command 'alpr' (...1ffc49) ['No plates found']  took 519ms
19:08:01:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...9c5170) ['No objects found']  took 619ms
19:08:01:Response rec'd from License Plate Reader command 'alpr' (...acd4c7) ['No plates found']  took 638ms
19:08:01:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...87b17d) ['No objects found']  took 749ms
19:08:01:Response rec'd from License Plate Reader command 'alpr' (...3d5456) ['No plates found']  took 761ms
19:08:01:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...21137e) ['No objects found']  took 618ms
19:08:01:Response rec'd from License Plate Reader command 'alpr' (...3ee627) ['No plates found']  took 630ms
19:08:02:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...ae9c92) ['No objects found']  took 437ms
19:08:02:Response rec'd from License Plate Reader command 'alpr' (...2af226) ['No plates found']  took 448ms
19:08:02:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...9091e4) ['No objects found']  took 316ms
19:08:02:Response rec'd from License Plate Reader command 'alpr' (...8146a4) ['No plates found']  took 335ms
19:08:02:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...363b3e) ['No objects found']  took 215ms
19:08:02:Response rec'd from License Plate Reader command 'alpr' (...a0d640) ['No plates found']  took 229ms
19:08:02:Response rec'd from Object Detection (YOLOv5 .NET) command 'custom' (...a6f7ce) ['No objects found']  took 221ms
19:08:02:Response rec'd from License Plate Reader command 'alpr' (...587592) ['No plates found']  took 234ms

edit: That's my own car, so there are no privacy concerns with me sharing it.
 
So I'm guessing I still have something misconfigured. Is there another place to look for logs to see what's not happening? Thanks!
Hmmm. This was configured as "Database Only", and I'm guessing maybe I need to store Hi-Res JPGs, no?
1738299490175.png


And then I'm also seeing that the Configure Web Request or MQTT dialog appears in both Trigger tab:

1738299717845.png

and the on the Alert tab:

1738299717869.png


I had set it up on the Trigger tab, because that's the first place I'd found it, and the docs don't really specify where it is. I've now populated the Alert tab the same way, so we'll see if anything shows up tomorrow morning when the vehicles start arriving.
 
On BI, go to clips and select alerts. Find the one where it should have read the plate, and control-click on it. This will bring up the AI stats, you can see how the image was processed.

1738301656436.png
 
Hmmm. This was configured as "Database Only", and I'm guessing maybe I need to store Hi-Res JPGs, no?
View attachment 213186

And then I'm also seeing that the Configure Web Request or MQTT dialog appears in both Trigger tab:

View attachment 213188
and the on the Alert tab:

View attachment 213187

I had set it up on the Trigger tab, because that's the first place I'd found it, and the docs don't really specify where it is. I've now populated the Alert tab the same way, so we'll see if anything shows up tomorrow morning when the vehicles start arriving.
Make sure you have the below settings
1738313956419.png