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

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.
 
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)
 
  • Like
Reactions: David L
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?
 
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
 
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.
 
  • Like
Reactions: nirt00
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.
 
  • Like
Reactions: Chris Dodge
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.
 
  • Like
Reactions: Chris Dodge
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.
 
  • Like
Reactions: Pentagano
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:
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
 
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!
 
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),
 
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?
 
have you tried reinstalling dot NET 8?
Yes, I also reinstalled visual studio installer and NET 6 in addition to 8

AI Tool version 2.2.24.8133 works fine

running
dotnet --list-runtimes

returns
Microsoft.AspNetCore.App 6.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
 
Yes, I also reinstalled visual studio installer and NET 6 in addition to 8

AI Tool version 2.2.24.8133 works fine

running
dotnet --list-runtimes

returns
Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Sorry, missed this.

When I look at the installer code it is literally calling 'dotnet --list-runtimes' and simply making sure '
Code:
Microsoft.NETCore.App 6.0.
' appears in the list.

It outputs the result of that command to "%TMP%\dotnet.txt" then deletes it when its done.

Perhaps if your %TMP% environment variable (as apposed to %TEMP%) is not set to a valid folder that could be a factor.

Can you get to it if you enter %TMP% in a file explorer address bar, or do you get an error?

You can force a log file to be created for the install that might help. Run this from an administrative command prompt:

Code:
"C:\PathToSetup\AIToolSetup.2.6.53.exe" /LOG="%TEMP%\AITOOLSETUP.LOG"