Blue Iris and CodeProject.AI ALPR

2nd topic... Memory leaks.

I definitely had memory leaks with Python when using CPAI 2.6.5. I had to create a scheduled job to stop/start CPAI every night.

With 2.9.5 I think I am too but I created the scheduled job again and I'm also rebooting the PC often so not 100% sure.

I usually don't post until I see someone else has the issue since I just assume it's only me. However, since I'm on a roll here... I have also noticed that when stopping the CPAI service, the Processes can continue to run after the service is stopped.

1747112946891.png
 
Last edited:
  • Like
Reactions: looney2ns
First, thank you for all the work here. :)

I'm trying to get this working, but many of the blue iris macros are not populated and I cannot figure out why. With my current setup, I do see the CodeProject.AI reported plate number logged in the memo of the alert image, but &JSON and other variables are simply empty.

If I remove "ai_dump":&JSON from the http post, I see this populated...

{"Image":"&ALERT_JPEG", "camera":"Cam1", "ALERT_PATH": "temp_Cam1_1.jpg", "ALERT_CLIP": "@-1", "timestamp":"2025-05-15T03:08:18.643Z" }

BlueIris 5.9.9.52 on Win11 host
CodeProject.AI 2.9.5 (License plate reader 3.3.4, Object Detection YOLOv5 6.2) on Win11 host (same host as BI)

Anything I can try to get the &JSON macro populated for the alert? I appreciate any help.

From the .dat file saved on the event...

Cam1.20250515_080000.913239.3-3.dat

[
{
"api":"alpr",
"found":{
"success":true,
"processMs":296,
"inferenceMs":172,
"predictions":[
{
"confidence":0.7903062701225281,
"label":"Plate: H******4",
"plate":"H******4",
"x_min":2182,
"y_min":906,
"x_max":2332,
"y_max":1011}
]
,
"message":"Found Plate: H******4",
"moduleId":"ALPR",
"moduleName":"License Plate Reader",
"code":200,
"command":"alpr",
"requestId":"a3751b8a-5060-4ad1-8908-c9b864e57373",
"inferenceDevice":"GPU",
"analysisRoundTripMs":327,
"processedBy":"localhost",
"timestampUTC":"Thu,
15 May 2025 15:15:16 GMT"}
}
]
 

Attachments

  • cam_alert_cfg.png
    cam_alert_cfg.png
    131.9 KB · Views: 0
  • ai_cfg.png
    ai_cfg.png
    111.5 KB · Views: 0
  • memo_thumb.png
    memo_thumb.png
    46.2 KB · Views: 0
  • bi_setting_ai.png
    bi_setting_ai.png
    130.6 KB · Views: 0
  • web_req.png
    web_req.png
    20.7 KB · Views: 0
Last edited:
First, thank you for all the work here. :)

I'm trying to get this working, but many of the blue iris macros are not populated and I cannot figure out why. With my current setup, I do see the CodeProject.AI reported plate number logged in the memo of the alert image, but &JSON and other variables are simply empty.

If I remove "ai_dump":&JSON from the http post, I see this populated...

{"Image":"&ALERT_JPEG", "camera":"Cam1", "ALERT_PATH": "temp_Cam1_1.jpg", "ALERT_CLIP": "@-1", "timestamp":"2025-05-15T03:08:18.643Z" }

BlueIris 5.9.9.52 on Win11 host
CodeProject.AI 2.9.5 (License plate reader 3.3.4, Object Detection YOLOv5 6.2) on Win11 host (same host as BI)

Anything I can try to get the &JSON macro populated for the alert? I appreciate any help.

Looks like you have an extra comma behind JSON, it should be:

{"ai_dump":&JSON, "Image":"&ALERT_JPEG", "camera":"&CAM", "ALERT_PATH":"&ALERT_PATH", "ALERT_CLIP":"&ALERT_CLIP", "timestamp":"&ALERT_TIME"}
 
Looks like you have an extra comma behind JSON, it should be:

{"ai_dump":&JSON, "Image":"&ALERT_JPEG", "camera":"&CAM", "ALERT_PATH":"&ALERT_PATH", "ALERT_CLIP":"&ALERT_CLIP", "timestamp":"&ALERT_TIME"}
Yea, sorry, that was a copy/paste error for the screenshot. Without the double comma, I get failures. Logging to a file show me that &JSON is empty, which causes a trainwreck for the ALPR tool. Any other ideas?