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

aesterling

Getting comfortable
Joined
Oct 9, 2017
Messages
352
Reaction score
346
Here is an update to my fork of @GentlePumpkin 's awesome tool.

Change log:
  • Camera option for 'Trigger Cancels' - Basically, rather than the URL triggering an event in BI, it will only be called when the detection is CANCELED. Note that you MUST change .22. As I understand this is how Sentry AI works - it just cancels a detection sent by BI. I haven't tested the 'Trigger cancels' camera checkbox yet since I dont have that configuration right now - let me know if it works.
(Along with previous updates like Deepstack (for windows) start/stop support, auto start, read BI camera settings, a LOG tab, save all cameras and settings to single JSON file, etc)

Hey @Chris Dodge and @B-Murda, could you please help me understand the use of &flagalert=1 and &flagalert=0 with AI Tool and BI?

I've seen two different methods discussed, and it's unclear to me if both are currently possible:
  1. With the first method, AI Tool would only send a "trigger cancel" command to BI if no relevant object is detected by AI Tool/Deepstack.
  2. With the second method, AI Tool would send a response to BI both when a relevant object is detected (&flagalert=1) and when no relevant object is detected (&flagalert=0).
Are both of these workflows currently possible with AI Tool and BI?
Do either of them rely on cloned cams, or can both methods work with only a single instance of a camera?
If I use the second method, do you fill both the Trigger URL and Cancel URL in AI Tool > Cameras > Actions > Settings?

Also, @B-Murda, you mentioned the Sentry appears to use the second method, but instead of setting the BI alert as Flagged, it instead has it's own custom value in BI, correct?
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
@aesterling - I've never actually tried using this method with BI, but I've made it so both methods should work

Trigger cancel: In actions dialog, leave "Trigger URL(s)" empty and fill out "Cancel URL(s)" with the url+flagalert=0

Send for both: In actions fill out Trigger URL and set to flagalert=1, and set Cancel URLs to flagalert=0

You might be able to do this with the Blueiris MQTT interface too but I havent looked into it yet. See more details for all the mqqt and admin command here:
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
@Chris Dodge I'm still working slowly to get this implemented. Couple of things...
1) Sometimes AITool gets stuck processing a .jpg and doesn't return to "Running" status. What should I check to help with that?
2) When it analyses a snapshot, A lot of times, the moving object is either not in frame or partially off-frame.
3) When re-launching the AITool, I have to Stop/Start Deepstack for it to be running correctly. At first launch, it reports that it is not activated. I Stop/Start and it okay.
4) My trigger action will not confirm within AITool by using the Test button. It works perfectly in a web browser. What should I do?

Thanks!
 
Last edited:

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
@Chris Dodge I'm still working slowly to get this implemented. Couple of things...
1) Sometimes AITool gets stuck processing a .jpg and doesn't return to "Running" status. What should I check to help with that?
2) When it analyses a snapshot, A lot of times, the moving object is either not in frame or partially off-frame.
3) When re-launching the AITool, I have to Stop/Start Deepstack for it to be running correctly. At first launch, it reports that it is not activated. I Stop/Start and it okay.

Thanks!
1) The log should show some of the last things it did before it freezes but most likely the Deepstack server has stopped responding. It is kind of buggy sometimes. After 60 seconds I think it will timeout with an error in the log. You may want to set up more deepstack servers on other machines to take over if one freezes.
2) Where are you looking at the object? On History tab or in Mask Manager? In Mask Manager it sometimes doesnt show the exact picture that originally had the object in it... Have to work out a better way to handle that. If in HISTORY tab that its wrong it could be the bug referenced a few pages back several times.
3) It is probably running fine and you dont have to stop/start. It wont say 'activated' because it doesnt really know until you get your first object detection back from deepstack server. Stopping and starting it just allows AITOOL to have full control over the processes and report output from deepstack.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
1) The log should show some of the last things it did before it freezes but most likely the Deepstack server has stopped responding. It is kind of buggy sometimes. After 60 seconds I think it will timeout with an error in the log. You may want to set up more deepstack servers on other machines to take over if one freezes.
2) Where are you looking at the object? On History tab or in Mask Manager? In Mask Manager it sometimes doesnt show the exact picture that originally had the object in it... Have to work out a better way to handle that. If in HISTORY tab that its wrong it could be the bug referenced a few pages back several times.
3) It is probably running fine and you dont have to stop/start. It wont say 'activated' because it doesnt really know until you get your first object detection back from deepstack server. Stopping and starting it just allows AITOOL to have full control over the processes and report output from deepstack.
1) Here's where the log picks up and shows the .jpg it froze on.

[21.09.2020, 15:19:55.143]: ImageQueueLoop> Adding task for file 'Driveway_AI.20200921_151954844.jpg' (Image QueueTime='0.0' mins, URL Queue wait='0ms', URLOrder=1 of 1, URLOriginalOrder=1) on URL ''
[21.09.2020, 15:19:55.145]: ImageQueueLoop> Done adding 1 total threads, ErrCnt=0, ImageProcessQueue.Count=0
[21.09.2020, 15:19:55.147]: DetectObjects> 127.0.0.1:81 - Starting analysis of S:\BI_AI\Driveway_AI.20200921_151954844.jpg...
[21.09.2020, 15:19:55.159]: DetectObjects> 127.0.0.1:81 - (1/6) Uploading a 312570 byte image to DeepQuestAI Server at [21.09.2020, 15:19:57.206]: DeepStack> Server.exe> [GIN] 2020/09/21 - 15:19:57 | 200 | 2.046302s | 127.0.0.1 | POST /v1/vision/detection
[21.09.2020, 15:19:57.207]: DetectObjects> 127.0.0.1:81 - (2/6) Posted in 2048ms, Received a 121 byte response.
[21.09.2020, 15:19:57.209]: DetectObjects> 127.0.0.1:81 - (3/6) Processing results...
[21.09.2020, 15:19:57.211]: DetectObjects> 127.0.0.1:81 - Detected objects: Person (99.68%),
[21.09.2020, 15:19:57.212]: DetectObjects> 127.0.0.1:81 - (4/6) Checking if detected object is relevant and within confidence limits:
[21.09.2020, 15:19:57.213]: Outsidemask> ->Camera has no mask, the object is OUTSIDE of the masked area.
[21.09.2020, 15:19:57.214]: DetectObjects> 127.0.0.1:81 - Person (99.68%) confirmed.
[21.09.2020, 15:19:57.216]: DetectObjects> 127.0.0.1:81 - The summary:person (99.68%)
[21.09.2020, 15:19:57.217]: DetectObjects> 127.0.0.1:81 - (5/6) Performing alert actions:
[21.09.2020, 15:20:00.847]: OnCreatedAsync>
[21.09.2020, 15:20:00.849]: OnCreatedAsync> ====================== Adding new image to queue (Count=1): S:\BI_AI\Driveway_AI.20200921_152000844.jpg
[21.09.2020, 15:20:01.127]: WaitForNextURL> ---- All URL's are in use or disabled, waiting...

2) Looking at the History tab.
3) Good to know, thanks!
4) I added #4 after you replied.

Appreciate it!
 
Joined
Sep 21, 2020
Messages
12
Reaction score
11
Location
UK
Feature Suggestion: This brilliant tool has made an incredible difference to my CCTV system. I started on the GentlePumpkin version and now I'm on the @Chris Dodge version. I have a complex setup of 15 cameras for various functions. It would be even better if there was an override option per camera of the Telegram Chat ID/Token. For example besides telegram messages for security when I'm not home I also send messages 24/7 for "person detections" at the rear of my property, others for people coming down my drive - a sort of advance doorbell and messages that cover cat/bird detections near the fish pond. Currently, these all come to the same telegram bot so have the same notification sound. If would be better if I had different bots set up for each type and could set different notifications. If I've missed something and there is already a way to achieve this then please let me know.
 

Eatoff

n3wb
Joined
Aug 28, 2020
Messages
19
Reaction score
3
Location
Australia
Feature suggestion: Add some kind of zoning in the AI tool.

Use case: I want detections for people walking past, but I would also want an additional event (via mqtt or some such) when that person walks into my driveway.

I think I may be able to set this up as a second camera in BI and achieve the same thing, but this would be much less clunky.
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
Hey folks, can you log feature suggestions and bugs for the VorlonCD mod up here? a bit easier than dealing with an 88 page monster :)


Try to include as much detail as you can and log entries if needed. make sure to remove any usernames/passwords from the log.
 

bat1939

n3wb
Joined
Sep 9, 2020
Messages
11
Reaction score
2
Location
United States
So the other day I thought the AI Tool program was running but come to find out it wasnt. Is anyone doing any kind of alerting or script to check if the program is running?
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
I've checked Task Manager and don't see another instance running. What should I do? Thanks!

[09:57:02.926]: RefreshInfo> Deepstack Desktop install path found in Uninstall registry: C:\DeepStack
[09:57:02.927]: GetDeepStackRun> DeepStack Desktop IS running from C:\DeepStack\server\server.exe
[09:57:02.927]: UpdateWatchers> * Another instance is already running, skip watching for changed files *
[09:57:02.947]: LoadFromCSVAsync> Loading history list from cameras/history.csv ...
[09:57:02.961]: Constructor> APP START complete.
[09:57:02.963]: GetDeepStackRun> DeepStack Desktop IS running from C:\DeepStack\server\server.exe
[09:57:02.971]: LoadFromCSVAsync> ...Loaded list in 22ms, 0 lines.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
I've checked Task Manager and don't see another instance running. What should I do? Thanks!

[09:57:02.926]: RefreshInfo> Deepstack Desktop install path found in Uninstall registry: C:\DeepStack
[09:57:02.927]: GetDeepStackRun> DeepStack Desktop IS running from C:\DeepStack\server\server.exe
[09:57:02.927]: UpdateWatchers> * Another instance is already running, skip watching for changed files *
[09:57:02.947]: LoadFromCSVAsync> Loading history list from cameras/history.csv ...
[09:57:02.961]: Constructor> APP START complete.
[09:57:02.963]: GetDeepStackRun> DeepStack Desktop IS running from C:\DeepStack\server\server.exe
[09:57:02.971]: LoadFromCSVAsync> ...Loaded list in 22ms, 0 lines.
AI Tools isn't working at all to read/analyze images from alerts. Based on what the log says above, what do you think? Thanks!
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
AI Tools isn't working at all to read/analyze images from alerts. Based on what the log says above, what do you think? Thanks!
Upon startup of the app it checks to see if aitool.exe is already running in the background. Thats the only time it checks, so if the other instances closes you have to close/reopen the app for it to know about it.

Otherwise in some versions of windows, the task manager DETAILS tab may have a "Show all processes" button that needs to be checked. It likely wont work correctly unless you have admin rights on the machine.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
Upon startup of the app it checks to see if aitool.exe is already running in the background. Thats the only time it checks, so if the other instances closes you have to close/reopen the app for it to know about it.

Otherwise in some versions of windows, the task manager DETAILS tab may have a "Show all processes" button that needs to be checked. It likely wont work correctly unless you have admin rights on the machine.
It's strange, I quit AI Tools and then check Task Manager showing all processes and it's not listed. Launch AI Tools and get the same thing.
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
Reboot. If still an issue, download Process Monitor > right click > run as administrator > Find menu > search for aitool.
Perhaps you have an old service for aitool.exe configured you forgot about?
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
Reboot. If still an issue, download Process Monitor > right click > run as administrator > Find menu > search for aitool.
Perhaps you have an old service for aitool.exe configured you forgot about?
That was it. Process Explorer found it was running. It launches now. I now have it analyzing images from 3 cameras. Reviewing the history shows it's identifying objects.

Next up, I need to figure out how to best manage the number of JPGs that get created. Ultimately, I have 10 cameras that I'd like to run this on and I can see exceeding the limit rather easily. I changed the max to 999 but I believe I can improve upon the trigger settings in BI. Right now, I have the AI cameras set to create a JPG every 6 seconds when triggered. Is that too many?

Also, I created cloned cameras to handle AI detection and when detected, AI Tools is triggering those same cameras to record a video. Is that a good practice? Perhaps not since I'd get two videos for each trigger on that camera. Thanks again!
 
Last edited:
Joined
Sep 23, 2020
Messages
1
Reaction score
0
Location
Oregon
freshly configured set up, getting a lot of 'error: could not access image' and no luck searching this thread on a possible fix. i increased the size of the folder the images are stored in and that seemed to help short term. i'm still receiving the images via telegram....mostly.
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
92
Reaction score
115
Location
massachusetts
freshly configured set up, getting a lot of 'error: could not access image' and no luck searching this thread on a possible fix. i increased the size of the folder the images are stored in and that seemed to help short term. i'm still receiving the images via telegram....mostly.
My mod of this tool should fix that error. Backup your current folder, Right-click the ZIP file > UNBLOCK, then overwrite the existing AI TOOLS folder with the contents of the zip
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
@Chris Dodge I have everything running well now with the VorlonCD fork. I love this! I ran across a previous post that mentioned a beta release of Deepstack that is supposed to do a better job. Just curious, what version of Deepstack should I be running on Windows 10? Appreciate it.
 

Tinbum

Pulling my weight
Joined
Sep 5, 2017
Messages
448
Reaction score
126
Location
UK
@Chris Dodge I have everything running well now with the VorlonCD fork. I love this! I ran across a previous post that mentioned a beta release of Deepstack that is supposed to do a better job. Just curious, what version of Deepstack should I be running on Windows 10? Appreciate it.
I run the beta and it finds people in all sorts of places, much much more than the original version. Some I can see why but the majority I can't (excepting genuine people). Its confidence always seems to be 90% + personally I think it needs a bit more work on it.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,046
Reaction score
951
I run the beta and it finds people in all sorts of places, much much more than the original version. Some I can see why but the majority I can't (excepting genuine people). Its confidence always seems to be 90% + personally I think it needs a bit more work on it.
The version I'm running is from May 2019. Is that the best one to use in your opinion?
 
Top