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

sansnil

n3wb
Joined
Oct 7, 2016
Messages
12
Reaction score
3
In case helpful to anyone... I'm new to VM's and Docker but have been getting educated on both so I can use the fantastic AI Tool with Blue Iris. :winktongue: Using the Docker version my average response time from an event trigger to being notified by BI was around 15 seconds which was longer than I liked. I discovered I could adjust the VM settings Docker/DeepStack runs on on my Windows Server box so the machine uses 4 cores instead of the default 1 and I upped the memory as well. Now I receive alerts in 5 seconds from start to finish which is much more to my liking and way faster than the Windows version of DS.

@GentlePumpkin the latest version 1.6.3 is still throwing the error on startup and periodically errors out when trying to analyze an image alert file from BI. I'm happy to send logs but there's not much helpful in there I can see:

[11.09.2019, 21:25:52]: Starting analysis of R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212532844.jpg
[11.09.2019, 21:25:52]: (1/6) uploading image to DeepQuestAI Server ...
[11.09.2019, 21:25:55]: Loading object rectangles...
[11.09.2019, 21:25:55]: (2/6) Waiting for results ...
[11.09.2019, 21:25:55]: (3a/6) Deserializing results ...
[11.09.2019, 21:25:55]: (3b/6) Processing results:
[11.09.2019, 21:25:55]: Detected objects:
[11.09.2019, 21:25:55]: -All objects read.
[11.09.2019, 21:25:55]: (6/6) Camera Plaza caused a false alert, nothing detected.
[11.09.2019, 21:25:55]: Adding false to history list.
[11.09.2019, 21:26:01]:
[11.09.2019, 21:26:01]: Starting analysis of R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212601455.jpg
[11.09.2019, 21:26:01]: ERROR: Processing the image R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212601455.jpg failed.
[11.09.2019, 21:26:02]:
[11.09.2019, 21:26:02]: Starting analysis of R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212602517.jpg
[11.09.2019, 21:26:02]: (1/6) uploading image to DeepQuestAI Server ...
[11.09.2019, 21:26:05]: (2/6) Waiting for results ...
[11.09.2019, 21:26:05]: (3a/6) Deserializing results ...
[11.09.2019, 21:26:05]: (3b/6) Processing results:
[11.09.2019, 21:26:05]: Detected objects:
[11.09.2019, 21:26:05]: -All objects read.
[11.09.2019, 21:26:05]: (6/6) Camera Plaza caused a false alert, nothing detected.
[11.09.2019, 21:26:05]: Adding false to history list.
[11.09.2019, 21:26:05]:
 

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
In case helpful to anyone... I'm new to VM's and Docker but have been getting educated on both so I can use the fantastic AI Tool with Blue Iris. :winktongue: Using the Docker version my average response time from an event trigger to being notified by BI was around 15 seconds which was longer than I liked. I discovered I could adjust the VM settings Docker/DeepStack runs on on my Windows Server box so the machine uses 4 cores instead of the default 1 and I upped the memory as well. Now I receive alerts in 5 seconds from start to finish which is much more to my liking and way faster than the Windows version of DS.

@GentlePumpkin the latest version 1.6.3 is still throwing the error on startup and periodically errors out when trying to analyze an image alert file from BI. I'm happy to send logs but there's not much helpful in there I can see:

[11.09.2019, 21:25:52]: Starting analysis of R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212532844.jpg
[11.09.2019, 21:25:52]: (1/6) uploading image to DeepQuestAI Server ...
[11.09.2019, 21:25:55]: Loading object rectangles...
[11.09.2019, 21:25:55]: (2/6) Waiting for results ...
[11.09.2019, 21:25:55]: (3a/6) Deserializing results ...
[11.09.2019, 21:25:55]: (3b/6) Processing results:
[11.09.2019, 21:25:55]: Detected objects:
[11.09.2019, 21:25:55]: -All objects read.
[11.09.2019, 21:25:55]: (6/6) Camera Plaza caused a false alert, nothing detected.
[11.09.2019, 21:25:55]: Adding false to history list.
[11.09.2019, 21:26:01]:
[11.09.2019, 21:26:01]: Starting analysis of R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212601455.jpg
[11.09.2019, 21:26:01]: ERROR: Processing the image R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212601455.jpg failed.
[11.09.2019, 21:26:02]:
[11.09.2019, 21:26:02]: Starting analysis of R:\Blue Iris\AI_Alerts/Plaza_AI.20190911_212602517.jpg
[11.09.2019, 21:26:02]: (1/6) uploading image to DeepQuestAI Server ...
[11.09.2019, 21:26:05]: (2/6) Waiting for results ...
[11.09.2019, 21:26:05]: (3a/6) Deserializing results ...
[11.09.2019, 21:26:05]: (3b/6) Processing results:
[11.09.2019, 21:26:05]: Detected objects:
[11.09.2019, 21:26:05]: -All objects read.
[11.09.2019, 21:26:05]: (6/6) Camera Plaza caused a false alert, nothing detected.
[11.09.2019, 21:26:05]: Adding false to history list.
[11.09.2019, 21:26:05]:
sansnil, thank you, this is good information. I'm still not certain where these error originate from, I think we have to look into this together once again :D. And since the source code is accessible now, everyone who wants is free to check my code!
 

RabenFlug

n3wb
Joined
Mar 16, 2016
Messages
9
Reaction score
3
Some days ago I installed the AI tool following the great step by step manual.
I'm very impressed by this very nice tool! I let it run for some days on different cameras around the house...with absolutely no false person recognitions!
Funny fact (I think this has been mentioned by other users in this thread before). The DeepStack AI often recognizes the dog as "human" :)
Not a problem ot the AI tool, I know.
GentlePumpkin, thanks you so much for spending your time in this, it's a very, very nice and spart tool! I love it!
 

Attachments

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
Some days ago I installed the AI tool following the great step by step manual.
I'm very impressed by this very nice tool! I let it run for some days on different cameras around the house...with absolutely no false person recognitions!
Funny fact (I think this has been mentioned by other users in this thread before). The DeepStack AI often recognizes the dog as "human" :)
Not a problem ot the AI tool, I know.
GentlePumpkin, thanks you so much for spending your time in this, it's a very, very nice and spart tool! I love it!
Dear RabenFlug, thank you for the kind words, it's very satisfactory to see that the software and the tutorial are as useful as I in good hope intended them to be. :)
 
Last edited:

Alan_F

Getting the hang of it
Joined
May 17, 2019
Messages
64
Reaction score
57
Location
Maryland
Would it possible to make the error notifications through Telegram optional in the next version? I am using the tool to detect people approaching the front door of my house. I am getting quite a few errors processing images and I don't need to be notified about them when they occur.
 

Tinbum

Pulling my weight
Joined
Sep 5, 2017
Messages
446
Reaction score
126
Location
UK
Would it possible to make the error notifications through Telegram optional in the next version? I am using the tool to detect people approaching the front door of my house. I am getting quite a few errors processing images and I don't need to be notified about them when they occur.
Do you know what is causing the errors?

I'm nearly up to 1/2 million alerts processed and I get very few errors, the only ones being if I shut down the computer while AI is processing alerts as docker seem to shut down first.
 

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
Would it possible to make the error notifications through Telegram optional in the next version? I am using the tool to detect people approaching the front door of my house. I am getting quite a few errors processing images and I don't need to be notified about them when they occur.
Yes, that should not be difficult to implement.
 

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
Do you know what is causing the errors?

I'm nearly up to 1/2 million alerts processed and I get very few errors, the only ones being if I shut down the computer while AI is processing alerts as docker seem to shut down first.
I still have no real clue why the Telegram Alerts happen, but it's eigther the internet connection being down or an issue at Telegram.
 

Tinbum

Pulling my weight
Joined
Sep 5, 2017
Messages
446
Reaction score
126
Location
UK
I think its errors 'processing images' that he's getting the telegram alerts for.
 

Alan_F

Getting the hang of it
Joined
May 17, 2019
Messages
64
Reaction score
57
Location
Maryland
That's correct - the errors are image processing errors, and I'm not sure what's causing them. I've checked a few of the images that caused the errors and they look ok to me.
 

Tinbum

Pulling my weight
Joined
Sep 5, 2017
Messages
446
Reaction score
126
Location
UK
Might be an idea to give us a few more details of your system and someone may be able to help.
 

Alan_F

Getting the hang of it
Joined
May 17, 2019
Messages
64
Reaction score
57
Location
Maryland
I appreciate the offer of help but the errors are just frequent enough to be annoying, but not frequent enough to impact my use of the tool. If I can prevent the image processing errors from sending Telegram alerts I'll be in good shape. It's probably not worth the time it would take to troubleshoot the source of the errors.

I'm saving an image from Blue Iris every 4 seconds on motion detection so if one image fails to process when someone approaches the door, the next image four seconds later will almost certainly process correctly and I'll get the alert. Even if it had two errors in a row, which seems pretty unlikely from what I've seen so far, I'd get a slightly delayed alert in 8 seconds. I'm using a two minute cool down to prevent multiple alerts for one event, and I haven't tested to see if the error triggers the cool down timer. If I did want the error alerts I don't think I'd want them to activate the cool down in case a valid alert came right after.

I always immediately pull out my phone and look at the image when I hear the Telegram alert sound and I don't want to be doing that just because of a processing error. I tried 'log everything' but the image processing error doesn't log anything more with that option checked. Just a single line saying error processing image with the filename.

I am not currently using the trigger URL option but I plan to set it up soon to look for any person in my driveway from midnight to 0500 hours. I'm going to call a URL on my Vera home automation system and run a scene that flashes a light in the bedroom to alert me to the presence of someone in the driveway. I don't know if the errors also trigger the URL, but I would definitely want the option to turn that off if they do. I don't want to be woken up just because of an error. I'll be setting the detection confidence threshold pretty high when I set this up because I really don't want any false alarms. The event I'm trying to detect probably happens about once every couple of years. I'd rather not detect it than deal with false alarms!

Thanks to the author for making this tool and all the ongoing development. It's made my cameras useful in a whole new way.
 

sansnil

n3wb
Joined
Oct 7, 2016
Messages
12
Reaction score
3
I use the Blue Iris mobile app which supports push alerts instead of Telegram and it doesn't send alerts for the image processing failures (I'm seeing the same issue as you with this) so this could be a workaround for you for now.
 

Alan_F

Getting the hang of it
Joined
May 17, 2019
Messages
64
Reaction score
57
Location
Maryland
I'll take a look at the Blue Iris mobile app, but I'm hoping we get a version that can ignore the errors soon. I could also just temporarily revert back to an older version of AI Tool that didn't send these alerts.

Just as another data point, I took two of the error images and simply copy/pasted them back into the folder where BI saves them. In both cases the image then processed without error. So it appears it isn't the image itself that is the issue. Could it be some other process accessing the image at the same time the AI Tool is trying to access it? This is a Windows 10 computer with OneDrive and Google Backup and Sync running, but neither of those apps should be doing anything with the drive or folders where BI saves video. The drive is indexed by Windows.

I was just watching the app and DeepStack server window when I got an error and can confirm that DeepStack didn't show any activity when the error fired, so it appears the error happens before AI Tool sends the images to the AI server.
 

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
Hello Alan_F and thank you for your description of your cctv setup. Even the great endlessly awesome artificial intelligence in the end still is artificial, so please do not expect no false detections. In my experience, especially moving plants can sometimes be detected as humans, so that happens, but seldomly.

To immediately stop receiving the error messages to Telegram, please just download v1.56, Telegram error messages were introduced with v1.62.

Your issue is on my to do list and if the error message is as you said, then the reason might be, that aitool tries to analyze the image before it's fully saved by Blue Iris. I already implemented that aitool waits 500ms before taking the image but recently reduced that to 100ms to enhance overall speed, so that might be the reason. I think I'll revert that and see if it helps. And I'll add an option to mute telegram error notifications.

Meanwhile, if somebody knows a little c# with visual studio, you can check and modify the code. From the first line on, I wrote many comments explaining what happens so reading up on the code should hopefully be relatively straightforward! gentlepumpkin/bi-aidetection
 

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
Short question to everyone: When upgrading to Blue Iris 5, did the AiTool detection stop working?

I installed Blue Iris 5 today and since then, no more images were stored into the Input folder for AITool because in the camera settings in the Trigger tab, the option 'Capture an alert list image' (which I think is new) was unchecked. If you experienced the same, please tell me so that we can keep the guide up to date.
 
Top