CodeProject.AI Version 2.0

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,218
Reaction score
4,259
Location
Brooklyn, NY
I'm having a hell of a time trying to get BI to send in the correct frame to CPAI ALPR. I have a fairly tight shot of cars driving by. They are in the frame for just under 1 second. An example:
View attachment 163197

What I'm finding is that BI is either sending the frames too early (only part of the car is visible) or is sending the frames too late and the car has moved out of the FOV so I'm getting nearly 100% of "nothing found" judging by me looking at the saved Hi-Res alert images. It's just alert images of an empty road most of time. I've played with trying to send it more/less images on the "+ real-time images" area of the AI trigger in BI. I've also played with the "analyze each one" time settings. I've increased/decreased them. It seems like it's a bit too complicated that we have to try and "time/calculate" what frames we think we need to send from BI to CPAI. Shouldn't there be an option to send every frame from the trigger in for analysis? The BI manual seems to state that is possible on page 86 but I don't see any option to select that anywhere.

I'm also finding that when I have two cars coming through, on the off chance BI sends in the correct frame to CPAI of the first car and it actually finds the plate, the alert is moved to confirmed and the second car following closely behind the first car is never analyzed.

I also seem to be getting lots of this in the CPAI Dashboard when running ALPR:

Code:
08:06:14:ALPR_adapter.py: [2023/05/16 08:06:14] ppocr WARNING: Since the angle classifier is not initialized, the angle classifier will not be uesd during the forward process
08:06:14:License Plate Reader:  [AttributeError] : Traceback (most recent call last):
  File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR.py", line 227, in read_plate_chars_PaddleOCR
    ocr_response = ocr.ocr(image, cls=True)
  File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv\lib\site-packages\paddleocr\paddleocr.py", line 555, in ocr
    dt_boxes, rec_res, _ = self.__call__(img, cls)
  File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv\lib\site-packages\paddleocr\tools\infer\predict_system.py", line 71, in __call__
    dt_boxes, elapse = self.text_detector(img)
  File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv\lib\site-packages\paddleocr\tools\infer\predict_det.py", line 244, in __call__
    self.input_tensor.copy_from_cpu(img)
  File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python37\venv\lib\site-packages\paddle\fluid\inference\wrapper.py", line 36, in tensor_copy_from_cpu
    self.copy_from_cpu_bind(data)
RuntimeError: (PreconditionNotMet) The third-party dynamic library (cudnn64_8.dll) that Paddle depends on is not configured correctly. (error code is 126)
  Suggestions:
  1. Check if the third-party dynamic library (e.g. CUDA, CUDNN) is installed correctly and its version is matched with paddlepaddle you installed.
  2. Configure third-party dynamic library environment variables as follows:
  - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`
  - Windows: set PATH by `set PATH=XXX; (at ..\paddle\phi\backends\dynload\dynamic_loader.cc:303)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR_adapter.py", line 40, in process
    result = await detect_platenumber(self, self.opts, image)
  File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR.py", line 181, in detect_platenumber
    (label, confidence, plateInferenceMs) = await read_plate_chars_PaddleOCR(module_runner, numpy_plate)
  File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR.py", line 278, in read_plate_chars_PaddleOCR
    module_runner.report_error_aync(ex, __file__)
AttributeError: 'ALPR_adapter' object has no attribute 'report_error_aync'
I'm using my GTX 3070 in my desktop to perform the ALPR. BI is sending images to that computer for analysis. That message is farily frequent in the logs. I'm also getting lots of normal logs as well:
Code:
08:06:14:License Plate Reader: Queue request for License Plate Reader command 'alpr' (...8718e5) took 132ms
08:06:14:Object Detection (YOLOv5 6.2): Detecting using license-plate
08:06:14:Object Detection (YOLOv5 6.2): Detecting using license-plate
08:06:14:Object Detection (YOLOv5 6.2): Queue request for Object Detection (YOLOv5 6.2) command 'custom' (...3457c8) took 58ms
. 
08:06:14:License Plate Reader: Queue request for License Plate Reader command 'alpr' (...23cc76) took 106ms
08:06:14:Object Detection (YOLOv5 6.2): Detecting using license-plate
08:06:14:Object Detection (YOLOv5 6.2): Queue request for Object Detection (YOLOv5 6.2) command 'custom' (...139ede) took 43ms
08:06:14:License Plate Reader: Queue request for License Plate Reader command 'alpr' (...7ee2ed) took 67ms
08:06:15:Object Detection (YOLOv5 6.2): Detecting using license-plate
08:06:15:Object Detection (YOLOv5 6.2): Queue request for Object Detection (YOLOv5 6.2) command 'custom' (...2a3695) took 42ms
08:06:15:Object Detection (YOLOv5 6.2): Detecting using license-plate
08:06:15:Object Detection (YOLOv5 6.2): Queue request for Object Detection (YOLOv5 6.2) command 'custom' (...b988c9) took 35ms
08:06:15:License Plate Reader: Queue request for License Plate Reader command 'alpr' (...c55547) took 58ms
The ALPR errors you are getting looks like you do not have CUDA installed correctly. You should be using CUDA 11.8 and cuDNN v8.9.1
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,581
Reaction score
2,882
The ALPR errors you are getting looks like you do not have CUDA installed correctly. You should be using CUDA 11.8 and cuDNN v8.9.1
Alright. I'll download it. I didn't do anything except install Nvidia drivers. The CPAI dashboard reports I'm running CUDA 12 so that must have come with the GPU drivers. I do get plates to recognize occasionally when the right frame is sent in to CPAI from BI. However, I get lots of "day plates" as the tag number read instead of the actual tag number. Perhaps not having CUDA 11.8 is the issue there.

Any idea on how send every frame on a trigger to CPAI from BI until a cancel or confirm happens?
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,218
Reaction score
4,259
Location
Brooklyn, NY
Any idea on how send every frame on a trigger to CPAI from BI until a cancel or confirm happens?
Settings shown in the below post will send every frame


1684246556225.png
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,581
Reaction score
2,882
Settings shown in the below post will send every frame


View attachment 163215
Excellent. That gives me some stuff to play around with today. Is it the "DoNotCancel" in the cancel field doing the magic of sending in every frame of the trigger? The manual seems to say putting anything in that field will allow the alert to continue if nothing in that "To Cancel" field was found.
 

BTRKY

Young grasshopper
Joined
Sep 21, 2016
Messages
39
Reaction score
14
Now that I have AI working well, I belive it is time to fine-tune. What are the best options to go in the "To Confirm, custom models" boxes? Also shown are the modules loaded.

This camera is my "driveway" camera. I'd also like LPR on this camera, but the alerts never show the plate; however, the plates are logged in the log fie.

Any recommendations for general outdoor area cameras?



1684249636177.png1684249645672.png
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,218
Reaction score
4,259
Location
Brooklyn, NY
Excellent. That gives me some stuff to play around with today. Is it the "DoNotCancel" in the cancel field doing the magic of sending in every frame of the trigger? The manual seems to say putting anything in that field will allow the alert to continue if nothing in that "To Cancel" field was found.
What does it is setting the camera to 20 FPS (50ms) and the below settings. The Cancel field can be anything, I just chose "DoNotCancel"

1684249804720.png
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,581
Reaction score
2,882
What does it is setting the camera to 20 FPS (50ms) and the below settings. The Cancel field can be anything, I just chose "DoNotCancel"

View attachment 163226
One last question Mike. How does BI handle the images it sends to CPAI if you set a pre trigger in the record menu? For example, If you had a pre trigger of 2 seconds on that camera then your shortest trigger would be 2.6 seconds and 2 seconds of it being "blank" footage of no car. Are those pre trigger images sent in?
 

JL-F1

Getting the hang of it
Joined
Jun 12, 2020
Messages
119
Reaction score
73
Location
USA
The ALPR errors you are getting looks like you do not have CUDA installed correctly. You should be using CUDA 11.8 and cuDNN v8.9.1
We only need 11.8 for alpr? I am not using ALPR and on on 2.18 using 11.7, no issues that I know of
 

AlphaBlueIris

Getting the hang of it
Joined
Jan 17, 2022
Messages
125
Reaction score
27
Location
Boston
I know I'm not giving enough info, I had a ferfect settings that would take the license plate everytime, alghouth it was never accurate but it was enough for me, simple guy here. For some reason, without changing anything, I get the app to recognize the day plate but it does not show the license number, any suggestion on what am doing wrong or is not working anymore? I rebooted many time, I did jot update codeproject or bi from what I know. Alghouth not sure if bi Auto updated. Thanks for any feedback.

Sent from my SM-S906U using Tapatalk
 

iikingli

Young grasshopper
Joined
Jan 8, 2016
Messages
47
Reaction score
15
It took me a while to get it going but have it running using GPU (DirecML) on Windows 11 without any issues. What worked for me was to update to the latest Graphics drivers and then install using "Option 1 with a vengeance" in the section "How to install a module" CodeProject.AI Discussions - CodeProject

You can also try to enable Auto Stop/Start with Blue Iris in the AI tab in Blue Iris Settings. This will allow you to toggle the "use GPU". Try to disable "use GPU", wait for BI to restart the Services/modules, and then enable "use GPU". you may have to restart your Blue Iris machine to ensure it loads correctly.

Edit: I'm running CPAI 2.1.8-Beta on a i7-11700 CPU using onboard Intel UHD 750 Graphics

View attachment 163172
Had to perform a clean reinstall all of the graphics drivers, (not upgrade), once that was completed had to remove and reinstall CodeProject and reboot, but it is now working.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,581
Reaction score
2,882
I downloaded and installed Cuda 11.8 and rebooted. CPAI dashboard still reports as CUDA 12. I'm not seeing that error message anymore however. I'm only getting this occasionally now:

Code:
14:33:14:ALPR_adapter.py: [2023/05/16 14:33:14] ppocr WARNING: Since the angle classifier is not initialized, the angle classifier will not be uesd during the forward process
CUDA 12 seems bundled with the Nvidia drivers. How do you actually go about pointing CPAI to using another installed version?
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,218
Reaction score
4,259
Location
Brooklyn, NY
I downloaded and installed Cuda 11.8 and rebooted. CPAI dashboard still reports as CUDA 12. I'm not seeing that error message anymore however. I'm only getting this occasionally now:

Code:
14:33:14:ALPR_adapter.py: [2023/05/16 14:33:14] ppocr WARNING: Since the angle classifier is not initialized, the angle classifier will not be uesd during the forward process
CUDA 12 seems bundled with the Nvidia drivers. How do you actually go about pointing CPAI to using another installed version?
You can ignore that WARNING the ALPR module will work fine.
What is shown in the System Info is misleading, this just show up to what CUDA version the GPU driver supports not the CUDA version installed.
To check which CUDA version you have installed you need to open a Command Prompt and run "nvcc --version"

1684269950075.png
1684270259679.png
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,581
Reaction score
2,882
You can ignore that WARNING the ALPR module will work fine.
What is shown in the System Info is misleading, this just show up to what CUDA version the GPU driver supports not the CUDA version installed.
To check which CUDA version you have installed you need to open a Command Prompt and run "nvcc --version"

View attachment 163244
View attachment 163246
Alright I'm definitely on 11.8. Thanks for your help!

I need to learn how to train my own models I think. I'm getting lots of misreads for plates here in Florida. Looks like I need to start reading up.
 

David L

IPCT Contributor
Joined
Aug 2, 2019
Messages
8,063
Reaction score
21,112
Location
USA
Now that I have AI working well, I belive it is time to fine-tune. What are the best options to go in the "To Confirm, custom models" boxes? Also shown are the modules loaded.

This camera is my "driveway" camera. I'd also like LPR on this camera, but the alerts never show the plate; however, the plates are logged in the log fie.

Any recommendations for general outdoor area cameras?



View attachment 163224View attachment 163225
The To confirm: is up to you, what ever you want, this is my list (person,dog,cat,bird,vehicle,car,truck,motorcycle,bus,bicycle,boat), whatever you don't want you can put in To cancel:

You put the Custom models: that correspond to the objects you want captured. This is Mike's List:
1684278854719.png

IPcam-general works for my Front CAM.

As far as LPR, an LPR CAM is a separate CAM focused on a specific location on a street. The LPR CAM has only one job, to capture license plates.
Notice how Mike's LPR is Zoomed in/Focused:


HTH
 

AlphaBlueIris

Getting the hang of it
Joined
Jan 17, 2022
Messages
125
Reaction score
27
Location
Boston
I know I'm not giving enough info, I had a ferfect settings that would take the license plate everytime, alghouth it was never accurate but it was enough for me, simple guy here. For some reason, without changing anything, I get the app to recognize the day plate but it does not show the license number, any suggestion on what am doing wrong or is not working anymore? I rebooted many time, I did jot update codeproject or bi from what I know. Alghouth not sure if bi Auto updated. Thanks for any feedback.

Sent from my SM-S906U using Tapatalk
My post got buried under other posts, anyone that can give me some kind of suggestions?

Sent from my SM-S906U using Tapatalk
 

David L

IPCT Contributor
Joined
Aug 2, 2019
Messages
8,063
Reaction score
21,112
Location
USA
My post got buried under other posts, anyone that can give me some kind of suggestions?

Sent from my SM-S906U using Tapatalk
I would check your settings to what Mike posted...

 

AlphaBlueIris

Getting the hang of it
Joined
Jan 17, 2022
Messages
125
Reaction score
27
Location
Boston
I would check your settings to what Mike posted...

Thank you

Sent from my SM-S906U using Tapatalk
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
Version 2.19 has been released. Does anyone know the changes?
 
Top