Blue Iris and CodeProject.AI ALPR

Wanted to get thoughts on why this is happening. I'm getting maybe 60-75% of plates on this camera but the ones that get missed seem to have this issue. AS you can see in the screenshot, it seems like the trigger is off. There's no vehicle at 0 and times after. Any suggestions?View attachment 155449View attachment 155450View attachment 155451
Try setting up a zone crossing in the middle of the FOV so BI will trigger when most of the vehicle is in the FOV
 
Wanted to get thoughts on why this is happening. I'm getting maybe 60-75% of plates on this camera but the ones that get missed seem to have this issue. AS you can see in the screenshot, it seems like the trigger is off. There's no vehicle at 0 and times after. Any suggestions?View attachment 155449View attachment 155450View attachment 155451

See this post in the thread:

 
  • Like
Reactions: MikeLud1
Try setting up a zone crossing in the middle of the FOV so BI will trigger when most of the vehicle is in the FOV
See this post in the thread:

I've been running this zone setup already which is why this is odd. Of course it's night so you can't see what's in the zone but you get the idea.LPCA.pngLPCB.pngZones.png
 
Those changes have been working well. I tweaked some of th zone settings and it's picking up most plates. This one confuses me though, not sure why BI canceled this alert.BI Cancel.png
 
BI 5.7.0.5 + CodeProject.AI 2.0.8-beta on W10 CPU only.

Questions:
#1: Does anyone know why license-plate identified the car below as DayPlate (instead of NightPlate) when it's dark and way past sunset. You can see my camera is already in night profile (B&W). Or it doesn't matter?

#2: This camera is: SD42212T-HN(-S2) , 2MP 12x Starlight PTZ Network Camera, 1/2.8” 2Megapixel STARVIS™ CMOS

I know there are some camera config tweaks to improve license number OCR, if you have it handy, let me know. Thanks.

AIdetails.pngAI settings.pngCamera exposure settings.png
 
Last edited:
I am also not getting the license-plate module to recognize using the GPU. Getting a Traceback error with no details every time it runs. Works fine on the CPU. I am using an older system - Core i7/3770K/32GB. YOLO works great on GPU. Screenshot 2023-03-04 093758.png with Nvidia 970/4GB
 
Those changes have been working well. I tweaked some of th zone settings and it's picking up most plates. This one confuses me though, not sure why BI canceled this alert.View attachment 155762
The reason for the cancel alert is because Detect/ignore static object is not tuned for ALPR. I am going to ask BI (Ken) to add advance settings for Detect/ignore static object so we can tune them better for ALPR.
You can try setting your camera to 20 FPS and then set analyze one each to 50ms. Then set + real-time images to an amount that will allow alert to capture images the whole time a car is in the FOV. My camera on average when a car triggers it is in the FOV for about 400ms to 500ms. So I set + real-time images to 12 (12 x 50ms = 600ms). With this setting I am getting all frames captured

1677944946055.png

1677942859569.png
 
@MikeLud1 BI 5.7.1, CP.AI 2.0.8-beta Looking at screenshots below, I assume this event should be "confirmed" but was put in "cancelled" in BI5.
Why did license-plate fail to confirm when confidence is 90+% in AI details. And Plates OCR extraction looks good (***I redacted my screenshots)

Side question, can I configure AI to only use Plates? Do I really need license-plate custom model?

BTW, using substream image (D1)
AI config.pngAI details.png
 
Last edited:
Hi all,

I've really enjoying playing with the new AI functionality, but I'm struggling with ALPR.

It's probably something I've missed, but I have a number of cameras, they seen to pick up a license plate with high certainty, but there is never even a partial match in the log from what I can see.
Either the images are all too low quality, or the AI is making no attemp whatsoever to actually resolve the plate itself.

1678220360951.png

1678220516400.png

1678220564419.png

1678220602973.png

1678220638488.png

Any ideas? Apologies if I've missed something stupid.
Thanks!
 
First off, thanks for setting this up. I have been meaning to add ALPR for a while and the camera has been in my attic for probably 2 years testing in the dark and light.

I setup CodeProject.AI in docker (beta 2.08) on another host on Linux yesterday. I have been able to do a little bit of face recognition, and object detection (cats, tables, etc). Gives me some confidence the server is set up correctly and BI can talk to it.

I turned on the ALPR function in BI and installed the plugin on the AI server. When I did that, everything kind of failed in BI....no detection of anything....

I started looking into the thread a bit (there is a lot here), and I just now trying to load a picture of a car with a clean plate into the server. That seems to not be working, so not surprised BI isn't working. I need to debug this first.

I know that picture looks small, but that license plate is pretty clear in the file. When I click "Read License plate", the upper write box says "sent request to server", and nothing happens. Log says this...

"17:31:47:Client request 'alpr' in the queue (...f99d1d)"

Screenshot 2023-03-07 at 5.28.49 PM.png


Here is my setup of the server....

Screenshot 2023-03-07 at 5.08.35 PM.png

Did I miss something here? I don't see the CPU pegging or anything like it is overwhelmed. I don't have a graphics card or any other acceleration running at this time-- though if this all works my guess is I might need some.


---------
Edit:
I do see this in the log...
16:58:45:
16:58:45:Started License Plate Reader module
16:58:45:ALPR_adapter.py: Traceback (most recent call last):
16:58:45:ALPR_adapter.py: File "/app/modules/ALPR/ALPR_adapter.py", line 8, in
16:58:45:ALPR_adapter.py: from analysis.codeprojectai import CodeProjectAIRunner
16:58:45:ALPR_adapter.py: File "/app/modules/ALPR/../../SDK/Python/analysis/codeprojectai.py", line 30, in
16:58:45:ALPR_adapter.py: import aiohttp
16:58:45:ALPR_adapter.py: ModuleNotFoundError: No module named 'aiohttp'
16:58:45:Module ALPR has shutdown
16:58:45:ALPR_adapter.py: has exited
16:58:46:Starting /app...ules/OCR/bin/linux/python38/venv/bin/python "/app/modules/OCR/OCR_adapter.py"
16:58:46:
16:58:46:Module 'Optical Character Recognition' (ID: OCR)
16:58:46:Active: True
16:58:46:GPU: Support disabled
16:58:46:Parallelism: 0
16:58:46:Platforms: windows,linux,macos,macos-arm64
16:58:46:FilePath: OCR_adapter.py
16:58:46:ModulePath: OCR
16:58:46:Install: PostInstalled
16:58:46:Runtime:
16:58:46:Queue: OCR_queue
16:58:46:Start pause: 1 sec
16:58:46:Valid: True
16:58:46:Environment Variables
16:58:46:
16:58:46:Started Optical Character Recognition module
16:58:46:OCR_adapter.py: Traceback (most recent call last):
16:58:46:OCR_adapter.py: File "/app/modules/OCR/OCR_adapter.py", line 8, in
16:58:46:OCR_adapter.py: from analysis.codeprojectai import CodeProjectAIRunner
16:58:46:OCR_adapter.py: File "/app/modules/OCR/../../SDK/Python/analysis/codeprojectai.py", line 30, in
16:58:46:OCR_adapter.py: import aiohttp
16:58:46:OCR_adapter.py: ModuleNotFoundError: No module named 'aiohttp'
16:58:47:Module OCR has shutdown

Interesting since it should be installed...

docker exec -it aicode_codeprojetai_1 bash

root@7fc37909277b:/app/server# pip3 install aiohttp

Requirement already satisfied: aiohttp in /usr/local/lib/python3.8/dist-packages (3.8.4)

Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (22.2.0)

Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (1.3.3)

Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (4.0.2)

Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (1.8.2)

Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (6.0.4)

Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (1.3.1)

Requirement already satisfied: charset-normalizer<4.0,>=2.0 in /usr/local/lib/python3.8/dist-packages (from aiohttp) (2.1.1)

Requirement already satisfied: idna>=2.0 in /usr/local/lib/python3.8/dist-packages (from yarl<2.0,>=1.0->aiohttp) (3.4)

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages

root@7fc37909277b:/app/server# cd /usr/
 
Last edited:
@rustyk try swapping the ALPR module in codeproject.ai to use CPU. A few folks including myself seem to have the same issue.

@wpiman try using the code project explorer and submit one of the images from the samples directory from the codeproject install instead of your own images. You might want to remove and reinstall code project (note that all you should need is YOLO and the ALPR module installed).
 
  • Like
Reactions: rustyk and wpiman
@rustyk try swapping the ALPR module in codeproject.ai to use CPU. A few folks including myself seem to have the same issue.

@wpiman try using the code project explorer and submit one of the images from the samples directory from the codeproject install instead of your own images. You might want to remove and reinstall code project (note that all you should need is YOLO and the ALPR module installed).

Thank you, I'll try that and report back.
 
@wpiman try using the code project explorer and submit one of the images from the samples directory from the codeproject install instead of your own images. You might want to remove and reinstall code project (note that all you should need is YOLO and the ALPR module installed).

Thanks... So I pulled the docker cpu-2.0.7 and tried everything clean. It is still erroring...


ai-server | Trace Response received (#reqid fcc11e79-b0c7-4ba5-9ed3-edb890d65d5f)
ai-server | Error ALPR: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ai-server | Error ALPR: sahi 0.11.11 requires click==8.0.4, but you have click 8.1.3 which is incompatible.

ai-server | Infor ALPR: Installing Packages into Virtual Environment...Success
ai-server | Error ALPR: 0K .......... .......... .......... .......... .......... 0% 518K 21s
ai-server | Error ALPR: 50K .......... .......... .......... .......... .......... 0% 571K 20s
ai-server | Error ALPR: 100K .......... .......... .......... .......... .......... 1% 39.9M 13s
ai-server | Error ALPR: 150K .......... .......... .......... .......... .......... 1% 1.52M 12s

------------------
The only thing different is when I read a plate now (from the training data now), it reports back

"Unable to create YOLO detector for model license-plate"

I am wondering if this has something to do with the fact that the container runs as root or something.....
 
@rustyk try swapping the ALPR module in codeproject.ai to use CPU. A few folks including myself seem to have the same issue.

@wpiman try using the code project explorer and submit one of the images from the samples directory from the codeproject install instead of your own images. You might want to remove and reinstall code project (note that all you should need is YOLO and the ALPR module installed).

Thank you, I can confirm that it started working once I disabled the GPU capability for ALPR.
 
Interesting.... I restarted the container without using the YML file and docker-compose and I see the plate..... Looks like it might be a permissions issue...

Screenshot 2023-03-08 at 12.34.14 PM.png
 
I am having some issues with my BI and cp.ai setup. I can see in the cp.ai server logs that it is detecting images and license plates but i am not seeing anything in the BI AI Status.

Here are my settings:

1678303748815.png

1678304265357.png

1678303764446.png
1678303777030.png

1678303802527.png

1678303811322.png

1678303821870.png

1678303834439.png

1678303846836.png