Blue Iris and CodeProject.AI ALPR

Hi @MikeLud1 , I have a specific case where I want to read numbers from the display and add them to the alert list just like LPR. I use ALPR in BI and it is reading the license plates with success. I tried to use ALPR for my use case and it is not working though it should read the numbers. CPAI has a module called OCR. That module does the job. Is there any way I can setup OCR in CPAI to do what I am looking for with BI? Attached are examples of what I have. Thanks.
I have seen several people ask about having just OCR. It would be best to ask Blue Iris to have an OCR option that sends the imager to the OCR module.
 
@MikeLud1 , just updated to 2.65 and realzied I never set up my LPR. The first page of this thread shows this as the suggested setup:

1725837842144.png

But the page prior shows you recommending this, is the below snip now the recommended setup? I.e., no DayPlate,NightPlate in the To confirm or Mark as vehicle section, put DoNotCancel in the To cancel section, use "objects:0,alpr" instead of "license-plate", and lastely don't click "Only for confirmed vehicle alerts"?

1725837881908.png
 
Trying to set up a new install of BI and CPAI. But having an issue with installing the lpr module but i keep getting an error. Any ideas?
1726619939015.png

1726619982910.png
 
Is an NVIDIA 1080 too old of a GPU? I've been using CPAI 2.8 and I can't get it to be used for inferences for LPR and general object detection using YOLO. 2.6.5 stopped working for some reason; despite repeated re-installs I could not get LPR to work at all under 2.6.5.
 
Is an NVIDIA 1080 too old of a GPU? I've been using CPAI 2.8 and I can't get it to be used for inferences for LPR and general object detection using YOLO. 2.6.5 stopped working for some reason; despite repeated re-installs I could not get LPR to work at all under 2.6.5.

I found it to not work very well and had better success with the CPU version.
 
I found it to not work very well and had better success with the CPU version.

The GPU version of LPR never did work for me; it works quite well on the CPU.

The object detection (YOLOv5 6.2) worked quite well on my GPU in the past, but it seems to not like it any more.

I am running CUDA 12.4 now though even though I was using the CUDA 11 version in the past. The 2.8 instructions seemed to say I should use "latest CUDA".

:shrug: I guess it generally works so I'll live with it; I'm definitely "getting my money's worth". I'm sure a new version will come in the future that improves on this all.
 
The GPU version of LPR never did work for me; it works quite well on the CPU.

The object detection (YOLOv5 6.2) worked quite well on my GPU in the past, but it seems to not like it any more.

I am running CUDA 12.4 now though even though I was using the CUDA 11 version in the past. The 2.8 instructions seemed to say I should use "latest CUDA".

:shrug: I guess it generally works so I'll live with it; I'm definitely "getting my money's worth". I'm sure a new version will come in the future that improves on this all.
With your NVIDIA 1080 you should be using CUDA 11.8. To downgrade to CUDA 11.8 you need to uninstall all versions of CUDA that are installed, uninstall cuDNN, uninstall the ALPR module. After uninstall reboot your PC then install CUDA 11.8, reboot, install cuDNN for CUDA 11, reboot, and then install the ALPR module.
 
I upgraded recently to the latest AIProject and now am no longer getting alerts. Looking at the AI dashboard, seems I have to manually install .net 8. Have done that. Also, I am using an older Nvidia 1050 GPU, assume these are the correct settings? Believe it is using CUDA 11.7.99

1727554185744.png
 
Also, still looking for a response to this post, not sure if it is the most recent "correct" settings as the first post is different from a later post you made @MikeLud1 !
 
I upgraded recently to the latest AIProject and now am no longer getting alerts. Looking at the AI dashboard, seems I have to manually install .net 8. Have done that. Also, I am using an older Nvidia 1050 GPU, assume these are the correct settings? Believe it is using CUDA 11.7.99

View attachment 203928
Are you on version 2.8.0, there was an issue with 2.6.5 that was causing .net not to auto restart.
 
With your NVIDIA 1080 you should be using CUDA 11.8. To downgrade to CUDA 11.8 you need to uninstall all versions of CUDA that are installed, uninstall cuDNN, uninstall the ALPR module. After uninstall reboot your PC then install CUDA 11.8, reboot, install cuDNN for CUDA 11, reboot, and then install the ALPR module.

Thanks Mike; downgrading to CUDA 11.8 got YOLOv5 6.2 running with the GPU, but now it seems the LPR module won't install.
1727561456204.png

This is back to the state I was previously.

Code:
2024-09-28 15:05:39: Preparing to install module 'ALPR'
2024-09-28 15:05:39: Downloading module 'ALPR'
2024-09-28 15:05:40: Installing module 'ALPR'
2024-09-28 15:05:40: Installer script at 'C:\Program Files\CodeProject\AI\setup.bat'
2024-09-28 15:05:40: ALPR: [0;33m[49m             Installing CodeProject.AI Analysis Module                [0m
2024-09-28 15:05:40: ALPR: [0;32m[49m======================================================================[0m
2024-09-28 15:05:40: ALPR: [0;32m[49m                   CodeProject.AI Installer                           [0m
2024-09-28 15:05:40: ALPR: [0;32m[49m======================================================================[0m
2024-09-28 15:05:40: ALPR: [0;37m[49m289.2Gb of 476Gb available on no (Windows 10 x86_64 - windows)[0m
2024-09-28 15:05:40: ALPR: [0;97m[104mGeneral CodeProject.AI setup                                          [0m
2024-09-28 15:05:41: ALPR: [0;39m[49mCreating Directories...[0m[0;92m[49mdone[0m
2024-09-28 15:05:41: ALPR: [0;97m[42mGPU support                                                           [0m
2024-09-28 15:05:41: ALPR: [0;39m[49mCUDA Present...[0m[0;32m[49mYes (CUDA 11.8, cuDNN 8.5)[0m
2024-09-28 15:05:41: ALPR: [0;39m[49mROCm Present...[0m[0;33m[49mNo[0m
2024-09-28 15:05:41: ALPR: [0;39m[49mChecking for .NET 8.0...[0m[0;39m[49mChecking runtimes...[0m[0;32m[49mAll good. .NET is 8.0.6[0m
2024-09-28 15:05:43: ALPR: [0;37m[49mReading ALPR settings[0m[0;37m[49m.[0m[0;37m[49m.[0m[0;37m[49m.[0m[0;37m[49m.[0m[0;37m[49m.[0m[0;37m[49m.[0m[0;37m[49m.[0m[0;32m[49mdone[0m
2024-09-28 15:05:43: ALPR: [0;97m[104mInstalling module License Plate Reader 3.3.0                          [0m
2024-09-28 15:05:43: ALPR: [0;37m[49mInternal module install[0m
2024-09-28 15:05:43: ALPR: [0;39m[49mInstalling Python 3.9[0m
2024-09-28 15:05:43: ALPR: [0;32m[49mPython 3.9 is already installed[0m
2024-09-28 15:05:51: ALPR: [0;39m[49mCreating Virtual Environment (Local)...[0m[0;32m[49mdone[0m
2024-09-28 15:05:51: ALPR: [0;39m[49mConfirming we have Python 3.9 in our virtual environment...[0m[0;32m[49mpresent[0m
2024-09-28 15:05:51: ALPR: [0;30m[49mDownloading ALPR models...[0m[0;95m[49malready exists...[0m[0;95m[49mExpanding...[0m[0;32m[49mdone.[0m
2024-09-28 15:05:51: ALPR: [0;39m[49mCopying contents of ocr-en-pp_ocrv4-paddle.zip to paddleocr...[0m[0;32m[49mdone[0m
2024-09-28 15:05:51: ALPR: [0;39m[49mInstalling Python packages for License Plate Reader[0m
2024-09-28 15:05:52: ALPR: [0;[49mInstalling GPU-enabled libraries: [0m[0;32m[49mIf available[0m
2024-09-28 15:05:53: ALPR: [0;39m[49mEnsuring Python package manager (pip) is installed...[0m[0;32m[49mdone[0m
2024-09-28 15:06:06: ALPR: [0;39m[49mEnsuring Python package manager (pip) is up to date...[0m[0;32m[49mdone[0m
2024-09-28 15:06:06: ALPR: [0;95m[49mPython packages specified by requirements.windows.cuda11_8.txt[0m
2024-09-28 15:06:15: ALPR: [0;39m[49m  - Installing NumPy, a package for scientific computing...[0m[0;32m[49m(✅ checked) [0m[0;32m[49mdone[0m
2024-09-28 15:06:17: ALPR: [0;39m[49m  - Installing PaddlePaddle, Parallel Distributed Deep Learning...[0m[0;91m[49m(⌠failed check) [0m[0;32m[49mdone[0m
2024-09-28 15:08:09: ALPR: [0;39m[49m  - Installing PaddleOCR, the OCR toolkit based on PaddlePaddle...[0m[0;32m[49m(✅ checked) [0m[0;32m[49mdone[0m
2024-09-28 15:08:11: ALPR: [0;39m[49m  - Installing imutils, the image utilities library...[0m[0;32m[49m(✅ checked) [0m[0;32m[49mdone[0m
2024-09-28 15:08:12: ALPR: [0;39m[49m  - Installing OpenCV, the Computer Vision library for Python...[0m[0;32m[49mAlready installed[0m
2024-09-28 15:08:24: ALPR: [0;39m[49m  - Installing the CodeProject.AI SDK...[0m[0;32m[49m(✅ checked) [0m[0;32m[49mdone[0m
2024-09-28 15:08:24: ALPR: [0;39m[49mScanning modulesettings for downloadable models...[0m[0;37m[49mNo models specified[0m
2024-09-28 15:08:24: ALPR: [0;39m[49mExecuting post-install script for License Plate Reader[0m
2024-09-28 15:08:24: ALPR: [0;39m[49mApplying PaddleOCR patch[0m
2024-09-28 15:08:24: ALPR:         1 file(s) copied.
2024-09-28 15:08:26: ALPR: Traceback (most recent call last):
2024-09-28 15:08:26: ALPR:   File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR_adapter.py", line 11, in <module>
2024-09-28 15:08:26: ALPR:     from ALPR import init_detect_platenumber, detect_platenumber
2024-09-28 15:08:26: ALPR:   File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR.py", line 17, in <module>
2024-09-28 15:08:26: ALPR:     from paddleocr import PaddleOCR
2024-09-28 15:08:26: ALPR:   File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\lib\site-packages\paddleocr\__init__.py", line 14, in <module>
2024-09-28 15:08:26: ALPR:     from .paddleocr import *
2024-09-28 15:08:26: ALPR:   File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\lib\site-packages\paddleocr\paddleocr.py", line 21, in <module>
2024-09-28 15:08:26: ALPR:     import paddle
2024-09-28 15:08:26: ALPR: ModuleNotFoundError: No module named 'paddle'
2024-09-28 15:08:26: ALPR: [0;39m[49mSelf test: [0m[0;91m[49mSelf-test failed[0m
2024-09-28 15:08:26: ALPR: [0;95m[49mModule setup time 00:02:44.21[0m
2024-09-28 15:08:26: ALPR: [0;97m[42mSetup complete                                                        [0m
2024-09-28 15:08:26: ALPR: [0;95m[49mTotal setup time 00:02:45.73[0m
2024-09-28 15:08:26: ALPR: [0;33m[49mSETUP FAILED:[0m
2024-09-28 15:08:26: ALPR:  - [ALPR] Self test failed
2024-09-28 15:08:26: Module ALPR installed successfully.
2024-09-28 15:08:26: Running module using: C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\Scripts\python
2024-09-28 15:08:26: 
2024-09-28 15:08:26: Attempting to start ALPR with C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\Scripts\python "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR_adapter.py"
2024-09-28 15:08:26: Starting C:\Program Files...ws\python39\venv\Scripts\python "C:\Program Files...\modules\ALPR\ALPR_adapter.py"
2024-09-28 15:08:26: 
2024-09-28 15:08:26: ** Module 'License Plate Reader' 3.3.0 (ID: ALPR)
2024-09-28 15:08:26: ** Valid:            True
2024-09-28 15:08:26: ** Module Path:      &lt;root&gt;\modules\ALPR
2024-09-28 15:08:26: ** Module Location:  Internal
2024-09-28 15:08:26: ** AutoStart:        True
2024-09-28 15:08:26: ** Queue:            alpr_queue
2024-09-28 15:08:26: ** Runtime:          python3.9
2024-09-28 15:08:26: ** Runtime Location: Local
2024-09-28 15:08:26: ** FilePath:         ALPR_adapter.py
2024-09-28 15:08:26: ** Start pause:      3 sec
2024-09-28 15:08:26: ** Parallelism:      0
2024-09-28 15:08:26: ** LogVerbosity:
2024-09-28 15:08:26: ** Platforms:        all,!windows-arm64
2024-09-28 15:08:26: ** GPU Libraries:    installed if available
2024-09-28 15:08:26: ** GPU:              use if supported
2024-09-28 15:08:26: ** Accelerator:
2024-09-28 15:08:26: ** Half Precision:   enable
2024-09-28 15:08:26: ** Environment Variables
2024-09-28 15:08:26: ** AUTO_PLATE_ROTATE            = True
2024-09-28 15:08:26: ** CROPPED_PLATE_DIR            = &lt;root&gt;\Server\wwwroot
2024-09-28 15:08:26: ** MIN_COMPUTE_CAPABILITY       = 6
2024-09-28 15:08:26: ** MIN_CUDNN_VERSION            = 7
2024-09-28 15:08:26: ** OCR_OPTIMAL_CHARACTER_HEIGHT = 60
2024-09-28 15:08:26: ** OCR_OPTIMAL_CHARACTER_WIDTH  = 30
2024-09-28 15:08:26: ** OCR_OPTIMIZATION             = True
2024-09-28 15:08:26: ** PLATE_CONFIDENCE             = 0.7
2024-09-28 15:08:26: ** PLATE_RESCALE_FACTOR         = 2
2024-09-28 15:08:26: ** PLATE_ROTATE_DEG             = 0
2024-09-28 15:08:26: ** REMOVE_SPACES                = False
2024-09-28 15:08:26: ** ROOT_PATH                    = &lt;root&gt;
2024-09-28 15:08:26: ** SAVE_CROPPED_PLATE           = False
2024-09-28 15:08:26: 
2024-09-28 15:08:26: Started License Plate Reader module
2024-09-28 15:08:26: Installer exited with code 1
2024-09-28 15:08:26: ALPR_adapter.py: Traceback (most recent call last):
2024-09-28 15:08:26: ALPR_adapter.py:   File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR_adapter.py", line 11, in <module>
2024-09-28 15:08:26: ALPR_adapter.py:     from ALPR import init_detect_platenumber, detect_platenumber
2024-09-28 15:08:26: ALPR_adapter.py:   File "C:\Program Files\CodeProject\AI\modules\ALPR\ALPR.py", line 17, in <module>
2024-09-28 15:08:26: ALPR_adapter.py:     from paddleocr import PaddleOCR
2024-09-28 15:08:26: ALPR_adapter.py:   File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\lib\site-packages\paddleocr\__init__.py", line 14, in <module>
2024-09-28 15:08:26: ALPR_adapter.py:     from .paddleocr import *
2024-09-28 15:08:26: ALPR_adapter.py:   File "C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\lib\site-packages\paddleocr\paddleocr.py", line 21, in <module>
2024-09-28 15:08:26: ALPR_adapter.py:     import paddle
2024-09-28 15:08:26: ALPR_adapter.py: ModuleNotFoundError: No module named 'paddle'
2024-09-28 15:08:26: ** Module ALPR has shutdown
2024-09-28 15:08:26: ALPR_adapter.py: has exited
2024-09-28 15:08:29: Module ALPR started successfully.

It looks like paddle wasn't installed. So I activated the python virtual environment and manually installed pappdle (suing instructions from here.
Code:
(venv) C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\Scripts>pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/

Now things start up as they should:
1727562418081.png

And I'm getting plate interferences again..

So it looks like paddle just didn't install for some reason. Works great now!
 
  • Like
Reactions: MikeLud1
I haven't had much luck with ALPR recently, but I've neglected my system after installing a few cameras a while back and setting up basic configurations.

I've recently renewed my BI maintenance plan, and need to get back into fine tuning my AI on these new cameras. I've also updated CPAI to 2.8, however the ALPR issue existed beforehand.

I removed CPAI completely (using the uninstaller, then removed files from c:/program data and c:/program files, and then installed 2.8. Upon installing with ALPR, I'm still getting issues when installing, which is what I've captured below.

Any idea on where to start with troubleshooting this? I have no knowledge of python or AI related coding

1728527147695.png
 
I haven't had much luck with ALPR recently, but I've neglected my system after installing a few cameras a while back and setting up basic configurations.

I've recently renewed my BI maintenance plan, and need to get back into fine tuning my AI on these new cameras. I've also updated CPAI to 2.8, however the ALPR issue existed beforehand.

I removed CPAI completely (using the uninstaller, then removed files from c:/program data and c:/program files, and then installed 2.8. Upon installing with ALPR, I'm still getting issues when installing, which is what I've captured below.

Any idea on where to start with troubleshooting this? I have no knowledge of python or AI related coding

View attachment 204647

This is the exact same problem I ran into. First, stop CP.AI.

Open an administrator windows shell and navigate to this directory in your CPAI installation:
C:\Program Files\CodeProject\AI\modules\ALPR\bin\windows\python39\venv\Scripts\

For background as to what this next step is, CodeProject.AI uses something called "python virtual environments". This is basically a self-contained python environment with a bunch of dependencies installed in it.

List the directory and you should see an "activate.bat" script. Run this from the command line.

Next, enter the following command:
pip install paddlepaddle-gpu==3.0.0b1 -i
This will install paddle with GPU support for CUDA 1.18.

Now, restart CP.AI.

It should work now.
 
HI

Much like PBC I have neglected my AI setup after it broke when I upgraded blue Iris. I think it broke as a result of the custom models field containing no entries but couldn’t remember how to correct it and therefore just gave up.

However I was hoping to get this working again so hence this post.

I think I have all the settings that I need and have upgraded to version 2.8.0. Initially the license plate reader wasn’t working but after following the instructions to reinstall paddle that seemed to resolve that issue.

1730708074902.png


My issue is when a alert is triggered no processing seems to be completed (see below for a screenshot of a dat file) It feels like this maybe a custom model issue as this is what went blank when I upgraded blue iris and stopped everything working but maybe me just barking up the wrong tree. I have tried to replicate the settings recommended by @MikeLud1 but suspect I missed something obvious

1730708103189.png





Here’s my current setting for reference:

1730708128013.png

1730708148200.png