[tool] [tutorial] Free AI Person Detection for Blue Iris

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
I still use AI Tool. I tried the AI built into BI, but I came back to AI Tool for two primary reasons. AI Tool allows the use of multiple AI servers so it can spread the workload across multiple machines for speed and redundancy. But more importantly when using AI Tool along with BI you have separate motion and AI masks. I find this feature useful for a few of my cameras.
What set up in the tool did you use to have a 2nd server of codeproject/deepstack to only use if the 1st option fails?
I've used several different services with different ports to work together on the same server but not before in the tool to failover to another url/port if the 1st one fails.

Thanks
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
Great - that's why I was considering going back to it for redunancy and the extra stationary object function was very useful.
So still all working fine I see.
Is the developer still maintaining it do you know?
I've made few changes in the last couple weeks to make working with redundant servers a little more reliable and fewer errors. Will try to release an update in a few days. I still personally use it because its more powerful and flexible compared to built in BI functionality. FYI you mentioned Deepstack, but you should really be using this as a replacement for deepstack: CodeProject.AI Server: AI the easy way.
 

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
I've made few changes in the last couple weeks to make working with redundant servers a little more reliable and fewer errors. Will try to release an update in a few days. I still personally use it because its more powerful and flexible compared to built in BI functionality. FYI you mentioned Deepstack, but you should really be using this as a replacement for deepstack: CodeProject.AI Server: AI the easy way.
Yes been using CPAI for a good while now - got rid of DS - thanks!
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
What set up in the tool did you use to have a 2nd server of codeproject/deepstack to only use if the 1st option fails?
I think in general it should use all the servers if needed in any case, but:

Settings > Queued:
On = All URL's will take a turn processing the images if not busy or offline.
Off = The original order is used. So for example the second one in the list will only be used if the first one is busy or is offline.

I'd also like to point out the latest version of CPAI has a "mesh" feature. I havent used it yet, but in theory that could do kind of the same thing AITOOL is doing. IE you only point to one server and IT connects to the other servers when needed.
 

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
I think in general it should use all the servers if needed in any case, but:

Settings > Queued:
On = All URL's will take a turn processing the images if not busy or offline.
Off = The original order is used. So for example the second one in the list will only be used if the first one is busy or is offline.

I'd also like to point out the latest version of CPAI has a "mesh" feature. I havent used it yet, but in theory that could do kind of the same thing AITOOL is doing. IE you only point to one server and IT connects to the other servers when needed.
ok thanks - got my CPAI running as a docker container on my NAS server (unraid) as this has the gpu.
Blueiris on a VM on proxmox.

If the NAS goes down for whatever reason then obviously have no connection. I have codeproject on the proxmox also as a proxmox lxc as a backup. Had to swap it over a couple of times.
Slower processing time on the intel but still better than nothing. Was thinking of using the lxc as the backup.
 

robpur

Getting comfortable
Joined
Jul 31, 2014
Messages
279
Reaction score
1,358
Location
Washington State
I'd also like to point out the latest version of CPAI has a "mesh" feature. I havent used it yet, but in theory that could do kind of the same thing AITOOL is doing. IE you only point to one server and IT connects to the other servers when needed.
One possible issue with using mesh is that if the first instance of CPAI doesn't respond then the whole chain of AI servers could be unavailable. When using queuing in AITOOL if the first server doesn't respond then a different one will be used. I have occasional trouble with CPAI running on my BI machine which is first in the chain. but no trouble with CPAI on my desktop. The difference might be that I'm running CUDA on the BI machine and CPU on the desktop. Whatever the reason I like the redundancy that AITOOL offers.
 

robpur

Getting comfortable
Joined
Jul 31, 2014
Messages
279
Reaction score
1,358
Location
Washington State
I've been playing with ntfy as a replacement for Pushover and have worked out a configuration for AITOOL. I've used Pushover for years and have been happy with it, but it won't run on GrapheneOS without Google services installed. Pushover and ntfy do about the same thing, but in different ways and with different feature sets. One feature that I have found useful in ntfy is the ability to push messages to a web browser as well as a phone. New images are pushed to the browser in real time, and optionally the browser will make a sound when a new image arrives.

chrome_ZWtnyGDJeQ.png

ntfy works on the Pub/Sub model. A topic is defined and devices can subscribe to the topic. When a message is published to the topic then any device subscribed to that topic will see the message. Kind of like a group chat. So if the ntfy phone App and a web browser are both subscribed to the same topic, then any messages published to that topic will be delivered to both devices. In the above image I have obscured the topic name since anybody with that name could view and publish on my account. Therefore topics should be created wisely. Make them longer and more complex for greater security. Just like passwords.

AITOOL has native support for Pushover and Telegram, but curl is used to send with ntfy. Here's the config that I'm currently using.

mstsc_uQHyLa1Tvf.png

The full Params line is:

-H "Authorization: Bearer tk_ob93rvkfhieftunhjolkwtklpwvxe" -T "C:\StoredAlerts\[ImageFilename]" ntfy.sh/MySecretTopic

This is for a paid ntfy account. If a free account is being used then the line would look like this:

-T "C:\StoredAlerts\[ImageFilename]" ntfy.sh/MySecretTopic

The long ugly code is representative of a token that a paid subscriber would receive. Free accounts are throttled and are limited to 2MB file attachments. Depending on the use case a free account might work fine, but while testing I exceeded the limits of a free account.

While testing I found that AITOOL needs to be run as an administrator to run curl correctly.

ntfy is open source and can be self-hosted. One negative aspect of ntfy is that the Android App is well done, but the IOS App is not. I've not seen the IOS App. I'm just going by what the developer said in an interview. Here's the interview.

Pushing ntfy to the next level with Philipp C. Heckel (Changelog Interviews #562)
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
Just pushed version 2.6.40:

Change log:
  • Moved to .NET 8. This should perhaps speed things up here and there. You may need to install from here: Download .NET 8.0 Desktop Runtime (v8.0.1) - Windows x64 Installer
  • Fixed issue where an AI Server may be stuck "InUse" if you close AITOOL while it was in use.
  • The next few items can help reduce annoying or unnecessary errors sent to telegram:
  • Fix blueiris httpclient trigger timeout error in cases where mutiple triggers have been made in 'queued' mode. (Prevent concurrent trigger calls to the same servername/port - The trigger call to blue iris will be skipped if it is currently already working on a trigger - Why does it take so long? Sometimes it takes over a minute to get done triggering?)
  • HTTP Trigger timeout defaults to 120 seconds rather than 55
  • Move trigger URL calls to after sound and a few other things for less of delay with other notification such as sound when running in a home office (Blueiris can take forever to finish its http trigger, so we dont wait for it now)
  • IgnoreConnectionError: JSON setting to ignore errors (not send them via telegram, etc if we cant even get a ping resonse from the server. This might be useful when a computer is only on certain hours of the day without setting a specific URL time range.
  • Checkbox in URL edit screen "Ignore if offline". When this is enabled, it will ping the server first and if the ping fails it will silently ignore and skip the URL. This is useful for when a server is a machine that may go to sleep and the time schedule is not consistent enough. In AI Servers list > LastSkippedReason column, you will see "NotOnline" when this happens. LastSkippedReason shows most recent reasons first.
  • AI Server list tweaked to provide more debug info about why it was not used and make it more threadsafe
  • AI Server list Double-click AI server to edit
  • AI Server list up/down now keeps selection
  • AI Server list now correctly refreshes every 1 so you can see it working live
  • Codeproject.AI now sometimes returns a "the request timed out" error. If you disable the "Error" checkbox when editing a SERVER, it will prevent this from being an error that is sent via telegram, etc. (Because I was starting to find it annoying) - I think it happened when a custom IPCAM model and the regular model were being accessed at the same time.
  • We used to look for Debug: error: warn: etc anywhere within the log line. Now its only within the first 6 chars not including dots, dashes, spaces. This might reduce less serious things from being sent to telegram, etc.
  • Fix to fully respect unchecking AUTO ADD on the deepstack tab 2.5.44 Custom models on "AiServerURL's" always saves as Linked. · Issue #334 · VorlonCD/bi-aidetection
  • Made sqldatabase history connection a little more reliable. If it gets an error on initial connection it will try to revert to a backup copy. If that failes it will delete the database and recreate it.
  • Exit right-click tray icon
  • New AI icon generated by ChatGPT (Of course!)
  • For refinement servers, you can now use 'Animal', 'Person', people or 'Vehicle' in addition to actual object names
  • Pause and resume right-click tray icon
  • Better error checking when trying to activate blue iris window as non admin
  • Fix crash on camera properties if you dont have a camera selected
  • Fix triggering object list sometimes empty
  • Fix ObjectListView issue, .net 7/8 changed virtualListSize to _virtualListSize
  • Code cleanup, update to latest nuget packages, fixing a few security issues
  • Added more return properties for Codeproject.ai response (not used yet)
  • Added Action time min/max ms to status bar
  • Is it worth trying to integrate other cloud vision AI tools when we have a decent local CodeProject.AI now? "Google.Cloud.Vision", "Azure AI Vision", "Imagga", etc?
 

nirt00

n3wb
Joined
May 11, 2021
Messages
5
Reaction score
1
Location
Israel
Thanks for the update.
I install aitool on second computer, but I cant reach BI, getting "got error while reading blueiris registry ".
I have ping to BI, remote registry is auto, if I open regedit I can connect to bi.
please help
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
Thanks for the update.
I install aitool on second computer, but I cant reach BI, getting "got error while reading blueiris registry ".
I have ping to BI, remote registry is auto, if I open regedit I can connect to bi.
please help
The "Remote Registry" service needs to be Automatic AND actually "started" on the machine with BlueIris installed.

Not sure, the firewall might need to be disabled too.

First, make sure in FILE EXPLORER, you can get to \\MACHINENAME\SHARENAME that you have created. Or \\MACHINENAME\c$

Then to test the registry open a COMMAND PROMPT from the second machine and type this:
Code:
reg query "\\machinename\hklm\software\perspective software\blue iris"
If you get a list of registry keys it is working as expected, but if it gives an error then something is still blocking the connection.
 

nirt00

n3wb
Joined
May 11, 2021
Messages
5
Reaction score
1
Location
Israel
The "Remote Registry" service needs to be Automatic AND actually "started" on the machine with BlueIris installed.

Not sure, the firewall might need to be disabled too.

First, make sure in FILE EXPLORER, you can get to \\MACHINENAME\SHARENAME that you have created. Or \\MACHINENAME\c$

Then to test the registry open a COMMAND PROMPT from the second machine and type this:
Code:
reg query "\\machinename\hklm\software\perspective software\blue iris"
If you get a list of registry keys it is working as expected, but if it gives an error then something is still blocking the connection.
Thanks for the help, your direction of checking reg query , gave me access denied. from there the solution was fast.

I added a REG_DWORD value HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/system/LocalAccountTokenFilterPolicy with the value of this entry is One, and that what solved my problem.
 

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
I think in general it should use all the servers if needed in any case, but:

Settings > Queued:
On = All URL's will take a turn processing the images if not busy or offline.
Off = The original order is used. So for example the second one in the list will only be used if the first one is busy or is offline.

I'd also like to point out the latest version of CPAI has a "mesh" feature. I havent used it yet, but in theory that could do kind of the same thing AITOOL is doing. IE you only point to one server and IT connects to the other servers when needed.
Fnally had time to tinker around a bit with the AI Tool again using an unused amd server to fire up a proxmox vm with the AI tool and CPAI on it.
2 server connections configured on the AI tool.
1st option is the master CPAI with the fast GPU on a remote server.
If this is unavailable then the 2nd server will use the slower CPAI on cpu on the same VM as the AI tool.
Bit of redunancy at least.

1st server - ticked ignore if offline - nothing else ticked
1nd server - ticked 'Use only as linked server - nothing else.

Run a trigger test and runs the 1st server only.


Shame we can't have a blueiris redundancy option!
I have proxmox machines with backups and a cluster so this is the best option for BI redundancy as far as I know.
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
Shame we can't have a blueiris redundancy option!
I have proxmox machines with backups and a cluster so this is the best option for BI redundancy as far as I know.
In a way I think you could have redundancy just in BI using CPAI Config web page (not BI) > MESH tab. (new feature a few versions back in CPAI) As long as all the computers have it enabled and can "see" each other, in theory they should work as a mesh? When I tested briefly, one in PROXMOX and one on my normal network they could NOT see each other because they were on different networks. (I assume they use a "broadcast message" to find other instances). But I'm sure there is a way to fix that.

>ticked ignore if offline
This is only needed if you dont want to see an error when the the first server is unpingable. But it will work exactly the same either way and always still roll over to the next server.

>nd server - ticked 'Use only as linked server - nothing else
You should not have that checked, otherwise it will never use it. "Linked" is only when you want to wait for 2 or more servers and get 'combined' results. Such as one regular server and one hosting "ipcam-animal". Its a way to get an opinion about movement from 2 different AI models and have the results combined into 1 - It IS slower if you have two but sometimes more accurate. ipcam-animal picks up stuff the default CPAI models dont and visa-versa.
 

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
In a way I think you could have redundancy just in BI using CPAI Config web page (not BI) > MESH tab. (new feature a few versions back in CPAI) As long as all the computers have it enabled and can "see" each other, in theory they should work as a mesh? When I tested briefly, one in PROXMOX and one on my normal network they could NOT see each other because they were on different networks. (I assume they use a "broadcast message" to find other instances). But I'm sure there is a way to fix that.



This is only needed if you dont want to see an error when the the first server is unpingable. But it will work exactly the same either way and always still roll over to the next server.



You should not have that checked, otherwise it will never use it. "Linked" is only when you want to wait for 2 or more servers and get 'combined' results. Such as one regular server and one hosting "ipcam-animal". Its a way to get an opinion about movement from 2 different AI models and have the results combined into 1 - It IS slower if you have two but sometimes more accurate. ipcam-animal picks up stuff the default CPAI models dont and visa-versa.
Thanks just checking out the mesh options.
No luck yet, got 3 instances on 3 different dockers. looks like I need to add udp and some other congigs in the json file.
None are seeing each other

Update: mesh slowing working, getting there
 
Last edited:

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
Mesh: How to add udp port also on the windows installation?
Docker is fairly easy but cannot find the setting in the json on that windows version.

Can anyone help? Also first 2 set up are not pinging each other. even with
"EnableStatusBroadcast": true,
"EnableStatusMonitoring": true,
"AcceptForwardedRequests": true,
"AllowRequestForwarding": true,

and udp/tcp enabled
 

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
Given up on the mesh option. Having major issues with the proxmox containers seeing each other.
CPAI on windows can be seen from all proxmox mesh nodes and the unraid cpai container node.
But that's it.

Also the aitool will not connect to any CPAI if the Mesh is on. It's one or the other.
Switched off mesh for now and left AITool running with 4 servers in the list.

Thanks!
 

Pentagano

Getting comfortable
Joined
Dec 11, 2020
Messages
612
Reaction score
282
Location
Uruguay
In a way I think you could have redundancy just in BI using CPAI Config web page (not BI) > MESH tab. (new feature a few versions back in CPAI) As long as all the computers have it enabled and can "see" each other, in theory they should work as a mesh? When I tested briefly, one in PROXMOX and one on my normal network they could NOT see each other because they were on different networks. (I assume they use a "broadcast message" to find other instances). But I'm sure there is a way to fix that.



This is only needed if you dont want to see an error when the the first server is unpingable. But it will work exactly the same either way and always still roll over to the next server.



You should not have that checked, otherwise it will never use it. "Linked" is only when you want to wait for 2 or more servers and get 'combined' results. Such as one regular server and one hosting "ipcam-animal". Its a way to get an opinion about movement from 2 different AI models and have the results combined into 1 - It IS slower if you have two but sometimes more accurate. ipcam-animal picks up stuff the default CPAI models dont and visa-versa.

To have redundancy for CPAI what method would you consider/tested is more effective?
CPAI Mesh function or AItool with several servers added?
Today I disabled the AItool (as it does not work with mesh enabled) and have 3 nodes in the mesh, 1st main node on unraid with the gpu, 2 other nodes on windows VM's with intel processors (of course a bit slower than the gpu),
 

chumoface

n3wb
Joined
Mar 26, 2022
Messages
4
Reaction score
1
Location
dc
I keep trying to update to 2.6.40 but I get a constant loop saying that it requires Microsoft .NET 6.0 , I have that and 8.0 installed. What other dependences do I need?
 

Tinbum

Pulling my weight
Joined
Sep 5, 2017
Messages
448
Reaction score
126
Location
UK
I keep trying to update to 2.6.40 but I get a constant loop saying that it requires Microsoft .NET 6.0 , I have that and 8.0 installed. What other dependences do I need?
2.6.54 is the latest.
 
Top