CodeProject.AI Version 2.0

Any thoughts on why I get this when license-plate is enabled?

19:31:43:objectdetection_queue: [Exception] : Error retrieving command [RuntimeError]: Session is closed
 
Hey Everybody, what type of detection times are you all getting with your GPUs? I have a Quadro K220, 4GB RAM and I'm seeing some really long processing times now.

Using the yolov5l model, I get ~45-55 ms processing time per image in CPAI with my modest Quadro P600 (2 GB GDDR5 with 384 CUDA cores). This is the time for CPAI to process an image and is the best number to use IMO, when accessing CPU or GPU performance. Using the AI time indicated in the BI log is a reflection of this CPAI processing time but also has a lot to do with how BI is set up and what is in the images themselves. It can be difficult to use BI AI log times as a metric to compare CPAI performance against others.
 
Hey Everyone,

Looking to migrate from Deepstack to CPAI. A few questions. I read through all 15 pages of this thread and 19 pages of the thread regarding CPAI 1.0.
1. Is there a version of CPAI we should be using? I see some are having issues with 2.07 and downgrading to 2.02. Others are staying on 1.6.8.
2. Can any camera work for ALPR or do I need one that actually is geared for reading license plates (just looking to repurpose a camera I'm not using)
3. I currently have an NVIDIA GTX 1060 3GB card and have driver version 526.47 installed. I also have CUDA 11.3 installed. I know CPAI requires CUDA 11.7.
a. Should I update to the newest driver - 528.24?
b. Should I uninstall Deekstack before installing CPAI? In the forums, I see MikeLud1 did not. If so, are there any folders that I should manually delete after the uninstall?
c. Can I just install CUDA 11.7 over 11.3 or should I uninstall 11.3 first?
d. What about cuDNN? It was already installed when I set up Deepstack. Will the install script just write over the existing cuDNN files or do I need to uninstall that first? I believe the uninstall is just basically deleting the files from the CUDA folder.
e. Should I be using the latest version of Blue Iris?

One last question. I'm using the custom models created by MikeLud1 and would like to continue using them. I understand they are automatically installed via the CPAI installer. I just need to clarify that if I use custom models, I need to use YOLOv5 v6.2 and Not YOLOv5.NET

I live 4 hours from my camera setup, and when I'm there, I have limited time to work on them . Hoping to get a good understanding on setting CPAI up so that the config is smooth and quick and I can get done what I need to while there.

Thanks,
Chris
 
  • Wow
Reactions: Nunofya
Hey Everyone,







Looking to migrate from Deepstack to CPAI. A few questions. I read through all 15 pages of this thread and 19 pages of the thread regarding CPAI 1.0.



1. Is there a version of CPAI we should be using? I see some are having issues with 2.07 and downgrading to 2.02. Others are staying on 1.6.8.



2. Can any camera work for ALPR or do I need one that actually is geared for reading license plates (just looking to repurpose a camera I'm not using)



3. I currently have an NVIDIA GTX 1060 3GB card and have driver version 526.47 installed. I also have CUDA 11.3 installed. I know CPAI requires CUDA 11.7.



a. Should I update to the newest driver - 528.24?



b. Should I uninstall Deekstack before installing CPAI? In the forums, I see MikeLud1 did not. If so, are there any folders that I should manually delete after the uninstall?



c. Can I just install CUDA 11.7 over 11.3 or should I uninstall 11.3 first?



d. What about cuDNN? It was already installed when I set up Deepstack. Will the install script just write over the existing cuDNN files or do I need to uninstall that first? I believe the uninstall is just basically deleting the files from the CUDA folder.



e. Should I be using the latest version of Blue Iris?







One last question. I'm using the custom models created by MikeLud1 and would like to continue using them. I understand they are automatically installed via the CPAI installer. I just need to clarify that if I use custom models, I need to use YOLOv5 v6.2 and Not YOLOv5.NET







I live 4 hours from my camera setup, and when I'm there, I have limited time to work on them . Hoping to get a good understanding on setting CPAI up so that the config is smooth and quick and I can get done what I need to while there.







Thanks,

Im

Chris

I'm no expert but here is a couple of things I found.
1) didn't work on the latest version but did on the latest stable version
2) the custom part didn't download, I had to copy them into the module folder
3) Yes you need YOLO v5 6.2
 
a solution to BI not using custom models
I installed CodeProject.AI a few days ago. It's been working sorta ok ... until something happens to cause the ‘Use custom models’ field in the Settings > AI page to go blank.

After this happens, all triggers result in short duration (<50 ms) ‘[nothing found]’ entries in the logfile, and I get no alerts in the Alerts list. This has happened twice now in the evening, resulting in no alerts all night (my cameras are configured to use only custom models).

I’ve not been able to identify anything in the Blue Iris logfile that hints at what triggers this. The evening time occurrence hinted at a profile change, but nothing in the logfile supported this. I've got a theory that it might be that the 'CodeProject.AI Server' service is crashing and restarting. I also had a theory that a crash/restart of the CP.AI service might be causing the Blue Iris Service to restart, but this was not supported by the logfile.

Sometimes stopping and restarting the AI service via the Settings > AI page button re-populated the ‘Use custom models’ field. But this did not always work (furthermore, the Blue Iris UI became sluggish and/or non-responsive, requiring patience I sometimes failed to have). To avoid the sluggish UI interface I also experimented with the HTTP Interface command /admin?ai, which also only sometimes worked.

Even a PC reboot did not always work.

In more testing today, I've determined that the Blue Iris ‘Use custom models’ field will successfully populate only if the 'CodeProject.AI Server' service status is "Running" when the Blue Iris Service starts.

To ensure this sequencing, I've done the following...

1. When booting the PC ... I've changed the Blue Iris Service 'Startup Type' to 'Automatic (Delayed Start)'. This delays starting the Blue Iris Service for a default 120 seconds, thus ensuring that the CP.AI service is already running... BTW, Googling will suggest that there is a way to tune the 120 seconds delay value for individual services (via a registry setting), however, other sites claim that this is a global setting only. My testing supports the later.

2. When the 'CodeProject.AI Server' service does not have the status "Running" .., I've created a PowerShell script that runs every few minutes from Task Scheduler. If it detects that the CP.AI service is not "Running", the script: a) restarts the CA.AI service, b) confirms it is running, and only then c) restarts the Blue Iris Service. It also notifies me that this has happened via a Pushover notification, and a custom entry in the Blue Iris logfile.

So far, these tweaks seem to be eliminating the short duration '[nothing found]’ triggers.

And yes, I have emailed Ken about this (several days ago). No response yet.

EDIT (2/6/23) - Just received a support response from someone named Antonio. The reply suggested not using custom models <sigh>.
 
Last edited:
Not sure if this is necessary but I also added the CodeProject folders to my Defender exclusion list. I have run 5.6.9.8 for just over 2 days since updating BI and CPAI 2.07 has cranked out over 68,000 detections without missing a beat. Strictly running CPU mode only and averaging 150-200ms. (ipcam-combined)

Screenshot 2023-02-05 183939.png
 
Hey Everybody, what type of detection times are you all getting with your GPUs? I have a Quadro K220, 4GB RAM and I'm seeing some really long processing times now.

I've offloaded my CPAI to another computer on my LAN that has a GTX1050Ti and getting times of ~40-80ms.

Still can't use custom models though for some reason.
 
Not sure if this is necessary but I also added the CodeProject folders to my Defender exclusion list. I have run 5.6.9.8 for just over 2 days since updating BI and CPAI 2.07 has cranked out over 68,000 detections without missing a beat. Strictly running CPU mode only and averaging 150-200ms. (ipcam-combined)

View attachment 153269

What CPU are you running it on? Whenever I try CPU only mode on my i5-11500 I get times of more than 9000ms.
 
Using the yolov5l model, I get ~45-55 ms processing time per image in CPAI with my modest Quadro P600 (2 GB GDDR5 with 384 CUDA cores). This is the time for CPAI to process an image and is the best number to use IMO, when accessing CPU or GPU performance. Using the AI time indicated in the BI log is a reflection of this CPAI processing time but also has a lot to do with how BI is set up and what is in the images themselves. It can be difficult to use BI AI log times as a metric to compare CPAI performance against others.

Thanks for the info. If I get 150ms it’s a miracle. Is there anything else that can be dragging my performance down?
 
I'm no expert but here is a couple of things I found.
1) didn't work on the latest version but did on the latest stable version
2) the custom part didn't download, I had to copy them into the module folder
3) Yes you need YOLO v5 6.2

Thanks for answering. I may just go the route of uninstalling everything first.
 
Hey Everybody, what type of detection times are you all getting with your GPUs? I have a Quadro K220, 4GB RAM and I'm seeing some really long processing times now.
I'm running an i7-11700 CPU with Intel UHD 750 Graphics, ipcam-general model on Medium. I'm getting 80-160ms with the GPU & YOLOv5 .NET, 250-400ms with the CPU & YOLOv5 6.2
 
Quick question, not looking to start a war, I just don’t understand why so many people are bothered about ALPR (ANPR here in the UK), I really don’t understand people's need/desire to record car number plates. What is the advantage people are getting from it? For me if something happens in my area and I want to review what happened and maybe contact the police I review my AI alerts for people and cars and if something happened with a car I just read the number plate with my own eyes from the recording. The only good reason I can think of for ALPR would be if you ran a car park, petrol station or some sort of automation that triggered based on certain plates.
 
Quick question, not looking to start a war, I just don’t understand why so many people are bothered about ALPR (ANPR here in the UK), I really don’t understand people's need/desire to record car number plates. What is the advantage people are getting from it? For me if something happens in my area and I want to review what happened and maybe contact the police I review my AI alerts for people and cars and if something happened with a car I just read the number plate with my own eyes from the recording. The only good reason I can think of for ALPR would be if you ran a car park, petrol station or some sort of automation that triggered based on certain plates.

To be honest I think a lot of people do it as a hobby or challenge. I have mine hooked up to a downstream system that alerts me when my parents arrive, or various friends. It’s not massively useful but it’s kinda fun to do.
 
What is the advantage people are getting from it?
I'll offer one simple use case. If/When something bad happens, you normally know the time to look at the videos yourself. Our neighborhood had something happen, and I got the night time license plate by reading it with my eyes, but then wanted to know if that vehicle had been in the neighborhood in the preceding days. I manually scrubbed through several weeks of video and ultimately found that same vehicle was in the neighborhood several days earlier. Being able to search history for that same plate number would have been nice compared to spending hours scrubbing through old video.

My cameras are just a personal hobby (not a business) so even though I spend way too much on cameras, I don't feel justified in paying much for an ALPR/ANPR subscription (I'm now using the PlateRecognizer free low tier), even though it would have been very useful for the one event that I just described.
 
Last edited:
I'll offer one simple use case. If/When sometime bad happens, you normally know the time to look at the videos yourself. Our neighborhood had something happen, and I got the night time license plate by reading it with my eyes, but then wanted to know if that vehicle had been in the neighborhood in the preceding days. I manually scrubbed through several weeks of video and ultimately found that same vehicle was in the neighborhood several days earlier. Being able to search history for that same plate number would have been nice compared to spending hours scrubbing through old video.

My cameras are just a personal hobby (not a business) so even though I spend way too much on cameras, I don't feel justified in paying much for an ALPR/ANPR subscription (I'm now using the PlateRecognizer free low tier), even though it would have been very useful for the one event that I just described.
Every word of this. I have done this multiple times for our neighborhood, and even looked up plates for situations that have happened outside of our neighborhood. The police just wanted to see if we had any footage of the vehicle(s) entering our neighborhood to see if we caught their plate, etc..
 
  • Like
Reactions: rbc1225