CodeProject.AI Version 2.0

AlphaBlueIris

Getting the hang of it
Joined
Jan 17, 2022
Messages
125
Reaction score
27
Location
Boston
If anyone is struggling with getting things to work with CPAI installation or configuration, by far the easiest way to deploy CPAI that I have found is via the docker container. There is nearly zero configuration (outside of how you launch the container itself) and you can easily upgrade/downgrade versions in a couple minutes with just a few commands. Those not familiar with using containers may find the concept difficult to follow, more so then the concept of a VM (virtual machine). In my case, I have a VM running Ubuntu (Linux), and run the CPAI container with docker in the VM (even with CUDA GPU acceleration but that takes more work installing CUDA in Linux). The setup in BI is just to point to the IP and port of the container. There are countless how-to articles and videos out there on deploying VMs, Docker containers, etc. and while it might take a bit of time to get it running for the first time, it is super easy after that. You might even consider running a free bare metal hypervisor like Proxmox and then have a Windows VM for BI and a Linux VM running the CPAI docker container all on the same computer. That is my setup for 15, 2K cameras and it has worked seamlessly for all versions of BI and CPAI that I have tried thus far. It is nice to have the CPAI folks configure everything for you (via the container) and you just download it and run it. I do not use any LPR functionality, so I cannot comment on the workings of that bit however.
Thank you for the great suggestion, I will give it a try expecially when I hear that you can revert back pretty quickly instead of 1 hour every time you try a new version.

Sent from my SM-S906U using Tapatalk
 

Corvus85

Getting the hang of it
Joined
Aug 18, 2021
Messages
498
Reaction score
79
Location
Australia
Hey all,

Updated to 2.0.7-Beta and now it doesn't detect any objects. Logs for the cancelled alerts don't really show anything obvious.
1675258030022.png


I've tried using both 'Object Detection (YOLOv5 .NET)' and 'Object Detection (YOLOv5 6.2)' both to no avail.
Rebooting the machine doesn't help.

My cameras are set to use the ipcam-dark at night and ipcam-general during the day though, so maybe the update deleted these custom models? If so, how can I get them working again?

I'm running 5.6.9.6.

Any ideas?
 

gwithers

Getting the hang of it
Joined
May 18, 2016
Messages
49
Reaction score
38
Hey all,

Updated to 2.0.7-Beta and now it doesn't detect any objects. Logs for the cancelled alerts don't really show anything obvious.
1675258030022.png


I've tried using both 'Object Detection (YOLOv5 .NET)' and 'Object Detection (YOLOv5 6.2)' both to no avail.
Rebooting the machine doesn't help.

My cameras are set to use the ipcam-dark at night and ipcam-general during the day though, so maybe the update deleted these custom models? If so, how can I get them working again?

I'm running 5.6.9.6.

Any ideas?
In my experience, a 3ms timing shows that BI is not finding the model(s) to use to detect anything and just returns nothing found more or less instantly. The camera may be sending images to a custom model but they aren't found on your CPAI instance or at least BI hasn't properly found them. Folks have had some problems with BI getting the list of custom models from CPAI and something like that is probably the issue. Others here would know better what could cause that as I have not run into that issue myself as of yet.
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,206
Reaction score
4,247
Location
Brooklyn, NY
Hey all,

Updated to 2.0.7-Beta and now it doesn't detect any objects. Logs for the cancelled alerts don't really show anything obvious.
1675258030022.png


I've tried using both 'Object Detection (YOLOv5 .NET)' and 'Object Detection (YOLOv5 6.2)' both to no avail.
Rebooting the machine doesn't help.

My cameras are set to use the ipcam-dark at night and ipcam-general during the day though, so maybe the update deleted these custom models? If so, how can I get them working again?

I'm running 5.6.9.6.

Any ideas?
Below are the locations of the custom models also the link to my GitHub Repo if you need the models

Object Detection (YOLOv5 6.2)

1675290388978.png

Object Detection (YOLOv5 .NET)

1675290466323.png
 

oak guy

n3wb
Joined
Feb 22, 2018
Messages
15
Reaction score
4
I'm seeing this error in the Status and Server Logs:

16:30:07:Started Object Detection (YOLOv5 6.2) module
16:30:08:Client request 'detect' in the queue (...bd7f6d)
16:30:08:detect_adapter.py: Traceback (most recent call last):
16:30:08:detect_adapter.py: File "C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\detect_adapter.py", line 16, in
16:30:08:detect_adapter.py: from analysis.codeprojectai import CodeProjectAIRunner
16:30:08:detect_adapter.py: File "../../SDK/Python\analysis\codeprojectai.py", line 36, in
16:30:08:detect_adapter.py: from analysis.requestdata import AIRequestData
16:30:08:detect_adapter.py: File "../../SDK/Python\analysis\requestdata.py", line 8, in
16:30:08:detect_adapter.py: from PIL import Image
16:30:08:detect_adapter.py: ImportError: cannot import name 'Image' from 'PIL' (unknown location)
16:30:08:Module ObjectDetectionYolo has shutdown
16:30:08:detect_adapter.py: has exited

Rebooted a number of times but I can't seem to get AI to keep running. Looks like I still have a configuration issue with an image file. Any ideas?
Thanks
Oakguy
 

MikeLud1

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,206
Reaction score
4,247
Location
Brooklyn, NY
I'm seeing this error in the Status and Server Logs:

16:30:07:Started Object Detection (YOLOv5 6.2) module
16:30:08:Client request 'detect' in the queue (...bd7f6d)
16:30:08:detect_adapter.py: Traceback (most recent call last):
16:30:08:detect_adapter.py: File "C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\detect_adapter.py", line 16, in
16:30:08:detect_adapter.py: from analysis.codeprojectai import CodeProjectAIRunner
16:30:08:detect_adapter.py: File "../../SDK/Python\analysis\codeprojectai.py", line 36, in
16:30:08:detect_adapter.py: from analysis.requestdata import AIRequestData
16:30:08:detect_adapter.py: File "../../SDK/Python\analysis\requestdata.py", line 8, in
16:30:08:detect_adapter.py: from PIL import Image
16:30:08:detect_adapter.py: ImportError: cannot import name 'Image' from 'PIL' (unknown location)
16:30:08:Module ObjectDetectionYolo has shutdown
16:30:08:detect_adapter.py: has exited

Rebooted a number of times but I can't seem to get AI to keep running. Looks like I still have a configuration issue with an image file. Any ideas?
Thanks
Oakguy
It looks like part of the install is missing try running a Repair

1675291268252.png
 

Corvus85

Getting the hang of it
Joined
Aug 18, 2021
Messages
498
Reaction score
79
Location
Australia
Below are the locations of the custom models also the link to my GitHub Repo if you need the models
The problem is that even when I disable the custom models, it still doesn't work.
I've 'repaired' the install as above multiple times with no effect.

Ideas?
 
Last edited:

Corvus85

Getting the hang of it
Joined
Aug 18, 2021
Messages
498
Reaction score
79
Location
Australia
Ok looks like I can get the standard yolo model to work using default object detection, but it gives me ridiculously high analysis times of 1000ms+, even on the small model size.
I desperately need the custom models working again.
Here's my settings.

1675298154152.png
1675298183468.png

I only want to use ipcam-combined and ipcam-animal.

Can anyone offer any insight?
 
Last edited:

Tinman

Known around here
Joined
Nov 2, 2015
Messages
1,209
Reaction score
1,476
Location
USA
Ok looks like I can get the standard yolo model to work using default object detection, but it gives me ridiculously high analysis times of 1000ms+, even on the small model size.
I desperately need the custom models working again.
Here's my settings.

View attachment 152769
View attachment 152770

I only want to use ipcam-combined and ipcam-animal.

Can anyone offer any insight?
The first screen don't look like version 5.6.9.6. Look at mine. You do not need to specify the custom model location. BI should find them automatically. Also you no longer need the objects:0.
Just use ipcam-combined,ipcam-animals

Screenshot 2023-02-01 185630.png
 

Corvus85

Getting the hang of it
Joined
Aug 18, 2021
Messages
498
Reaction score
79
Location
Australia
The first screen don't look like version 5.6.9.6. Look at mine. You do not need to specify the custom model location. BI should find them automatically. Also you no longer need the objects:0.
Just use ipcam-combined,ipcam-animals
That's because I rolled back to an earlier stable version of BI to test.
Nevertheless, I just installed 5.6.9.6 and rebooted.
When I click the custom model installation folder, it only says the following models are installed:

1675299857615.png
How can this be possible if there are clearly more models in the folder?

1675299889816.png
1675301058159.png

Regardless, it still results in 'nothing found'.

1675299999005.png

Any ideas?
 
Last edited:

rbc1225

Getting the hang of it
Joined
Jan 11, 2023
Messages
108
Reaction score
29
Location
Lees Summit MO
Okay guys, I got 1.6.8 installed and still have issues with the License Plate reader. I am at a loss. Evidently there is something wrong on my machine. Thanks for all your help.

1675301226402.png
 

Philip Gonzales

Getting comfortable
Joined
Sep 20, 2017
Messages
697
Reaction score
551
I am also having issuing getting CPAI working, when previously it was working great. I guess that's what I get for always wanting to be on the bleeding edge. I've also tried repair reinstalling, rebooting, etc.
:(

I upgraded to 2.0.7-Beta yesterday and I stopped getting alerts after this. I uninstalled and installed 2.0.6-Beta and now I'm seeing this in the Server Logs.

Code:
19:20:13: Started Object Detection (YOLOv5 6.2) module
19:20:13: detect_adapter.py: Traceback (most recent call last):
19:20:13: detect_adapter.py:   File "C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\detect_adapter.py", line 16, in
19:20:13: detect_adapter.py:     from analysis.codeprojectai import CodeProjectAIRunner
19:20:13: detect_adapter.py:   File "../../SDK/Python\analysis\codeprojectai.py", line 36, in
19:20:13: detect_adapter.py:     from analysis.requestdata import AIRequestData
19:20:13: detect_adapter.py:   File "../../SDK/Python\analysis\requestdata.py", line 8, in
19:20:13: detect_adapter.py:     from PIL import Image
19:20:13: detect_adapter.py: ImportError: cannot import name 'Image' from 'PIL' (unknown location)
19:20:13: detect_adapter.py: has exited
19:20:14: Error trying to start Object Detection (YOLOv5 6.2) (detect_adapter.py)
19:20:15: An item with the same key has already been added. Key: ObjectDetectionYolo
19:20:15:    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at CodeProject.AI.API.Server.Frontend.ModuleRunner.StartProcess(ModuleConfig module)
19:20:15: *** Please check the CodeProject.AI installation completed successfully
19:20:16: Queued: 'list-custom' request, id e45cb070-775e-4ce6-a0c1-ae1d01daf9fb
19:20:18: Latest version available is 2.0.7-Beta
19:20:18: Current Version is 2.0.6-Beta
19:20:18:  *** A new version 2.0.7-Beta is available **
19:20:33: Latest version available is 2.0.7-Beta
19:21:24: Latest version available is 2.0.7-Beta
19:21:29: Latest version available is 2.0.7-Beta
19:21:57: Latest version available is 2.0.7-Beta
19:21:57: Latest version available is 2.0.7-Beta
19:21:59: Latest version available is 2.0.7-Beta
19:22:06: ObjectDetectionYolo has left the building
Code:
19:22:06: Started Object Detection (YOLOv5 6.2) module
19:22:07: detect_adapter.py: Traceback (most recent call last):
19:22:07: detect_adapter.py:   File "C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\detect_adapter.py", line 16, in
19:22:07: detect_adapter.py:     from analysis.codeprojectai import CodeProjectAIRunner
19:22:07: detect_adapter.py:   File "../../SDK/Python\analysis\codeprojectai.py", line 36, in
19:22:07: detect_adapter.py:     from analysis.requestdata import AIRequestData
19:22:07: detect_adapter.py:   File "../../SDK/Python\analysis\requestdata.py", line 8, in
19:22:07: detect_adapter.py:     from PIL import Image
19:22:07: detect_adapter.py: ImportError: cannot import name 'Image' from 'PIL' (unknown location)
19:22:07: detect_adapter.py: has exited
19:23:06: Latest version available is 2.0.7-Beta
 

Philip Gonzales

Getting comfortable
Joined
Sep 20, 2017
Messages
697
Reaction score
551
I am also having issuing getting CPAI working, when previously it was working great. I guess that's what I get for always wanting to be on the bleeding edge. I've also tried repair reinstalling, rebooting, etc.
:(

I upgraded to 2.0.7-Beta yesterday and I stopped getting alerts after this. I uninstalled and installed 2.0.6-Beta and now I'm seeing this in the Server Logs.

Code:
19:20:13: Started Object Detection (YOLOv5 6.2) module
19:20:13: detect_adapter.py: Traceback (most recent call last):
19:20:13: detect_adapter.py:   File "C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\detect_adapter.py", line 16, in
19:20:13: detect_adapter.py:     from analysis.codeprojectai import CodeProjectAIRunner
19:20:13: detect_adapter.py:   File "../../SDK/Python\analysis\codeprojectai.py", line 36, in
19:20:13: detect_adapter.py:     from analysis.requestdata import AIRequestData
19:20:13: detect_adapter.py:   File "../../SDK/Python\analysis\requestdata.py", line 8, in
19:20:13: detect_adapter.py:     from PIL import Image
19:20:13: detect_adapter.py: ImportError: cannot import name 'Image' from 'PIL' (unknown location)
19:20:13: detect_adapter.py: has exited
19:20:14: Error trying to start Object Detection (YOLOv5 6.2) (detect_adapter.py)
19:20:15: An item with the same key has already been added. Key: ObjectDetectionYolo
19:20:15:    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at CodeProject.AI.API.Server.Frontend.ModuleRunner.StartProcess(ModuleConfig module)
19:20:15: *** Please check the CodeProject.AI installation completed successfully
19:20:16: Queued: 'list-custom' request, id e45cb070-775e-4ce6-a0c1-ae1d01daf9fb
19:20:18: Latest version available is 2.0.7-Beta
19:20:18: Current Version is 2.0.6-Beta
19:20:18:  *** A new version 2.0.7-Beta is available **
19:20:33: Latest version available is 2.0.7-Beta
19:21:24: Latest version available is 2.0.7-Beta
19:21:29: Latest version available is 2.0.7-Beta
19:21:57: Latest version available is 2.0.7-Beta
19:21:57: Latest version available is 2.0.7-Beta
19:21:59: Latest version available is 2.0.7-Beta
19:22:06: ObjectDetectionYolo has left the building
Code:
19:22:06: Started Object Detection (YOLOv5 6.2) module
19:22:07: detect_adapter.py: Traceback (most recent call last):
19:22:07: detect_adapter.py:   File "C:\Program Files\CodeProject\AI\AnalysisLayer\ObjectDetectionYolo\detect_adapter.py", line 16, in
19:22:07: detect_adapter.py:     from analysis.codeprojectai import CodeProjectAIRunner
19:22:07: detect_adapter.py:   File "../../SDK/Python\analysis\codeprojectai.py", line 36, in
19:22:07: detect_adapter.py:     from analysis.requestdata import AIRequestData
19:22:07: detect_adapter.py:   File "../../SDK/Python\analysis\requestdata.py", line 8, in
19:22:07: detect_adapter.py:     from PIL import Image
19:22:07: detect_adapter.py: ImportError: cannot import name 'Image' from 'PIL' (unknown location)
19:22:07: detect_adapter.py: has exited
19:23:06: Latest version available is 2.0.7-Beta
Looks like I am back up an running. Here is what I did to fix my issue.

1. Uninstall CPAI
2. Rebooted
3. Renamed C:\Program Files\CodeProject to C:\Program Files\CodeProject_Old
4. Installed 2.0.6-Beta and now I'm back up and running.
 

Dixit

Getting the hang of it
Joined
Dec 14, 2015
Messages
75
Reaction score
36
What I dont get is why does the custom models folder not entirely honor whats in there. I know I mentioned this before on the other thread, but I always used Yolov5l.pt as it was fairly decent on detection for me, previously I always just put it in the custom models folder and just called that model in the custom models box for each camera.

Now I find it doesnt even listen to it or honor it. Even though its listed it does nothing. If I go to AI tab and click the three buttons it only shows the models (in my case IPCAM-General as I moved the other ones off to another folder) of ipcam-general even though yolov5l is in there. I tried the whole default object detection and set it to large and it just is no where near that original speed and it keeps crashing the entire CodeProject every so often, sometimes even every 15mins, so moved it to Medium and its still crashing it.

So for now testing ipcam-general to see what happens.
 

Tinman

Known around here
Joined
Nov 2, 2015
Messages
1,209
Reaction score
1,476
Location
USA
That's because I rolled back to an earlier stable version of BI to test.
Nevertheless, I just installed 5.6.9.6 and rebooted.
When I click the custom model installation folder, it only says the following models are installed:

View attachment 152776
How can this be possible if there are clearly more models in the folder?

View attachment 152777
View attachment 152780

Regardless, it still results in 'nothing found'.

View attachment 152778

Any ideas?
you need to use yolov56.2 to use custom models. Yolov5.NET ONLY works on "default object detection. Be sure to turn off .NET before you start Yolov56.2

Screenshot 2023-02-01 210148.png
 

Tinman

Known around here
Joined
Nov 2, 2015
Messages
1,209
Reaction score
1,476
Location
USA
Looks like I am back up an running. Here is what I did to fix my issue.

1. Uninstall CPAI
2. Rebooted
3. Renamed C:\Program Files\CodeProject to C:\Program Files\CodeProject_Old
4. Installed 2.0.6-Beta and now I'm back up and running.
"
You Always should delete the codeproject folder in "Program Files" and "Program Data" when reinstalling CPAI.
 

Tinman

Known around here
Joined
Nov 2, 2015
Messages
1,209
Reaction score
1,476
Location
USA
What I dont get is why does the custom models folder not entirely honor whats in there. I know I mentioned this before on the other thread, but I always used Yolov5l.pt as it was fairly decent on detection for me, previously I always just put it in the custom models folder and just called that model in the custom models box for each camera.

Now I find it doesnt even listen to it or honor it. Even though its listed it does nothing. If I go to AI tab and click the three buttons it only shows the models (in my case IPCAM-General as I moved the other ones off to another folder) of ipcam-general even though yolov5l is in there. I tried the whole default object detection and set it to large and it just is no where near that original speed and it keeps crashing the entire CodeProject every so often, sometimes even every 15mins, so moved it to Medium and its still crashing it.

So for now testing ipcam-general to see what happens.
OK. If you are going to try 2.07 then you need to be on the latest version of BI. There is no need to add models or move them, you will just screw up the CPAI. To use the yolov5l you must use "Default object detection" Then just select what size of model you want. This is why we suggest to delete the folders when re installing CPAI to be sure everything is in the right place.
 

Attachments

Top