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

spammenotinoz

Pulling my weight
Joined
Apr 4, 2019
Messages
172
Reaction score
106
Location
Sydney
Spammenotinoz,

I am interested in your configuration of BI to capture a jpeg from the main stream. My current configuration is using a cloned camera for motion detection. It is using the main and sub streams in there standard corresponding locations. The clone triggers on motion and generates a jpeg from the sub-stream. The clone master records 24X7 and is triggered by external URL from my home automation system.

The only way I have been able to get a jpeg from the mainstream is to setup a second camera using only the main stream. My CPU usage has increased using the mainstream on this camera for motion detection. One other question, what have you found is an acceptable image resolution that provides a good balance between DeepStack processing speed and object identification accuracy?
Sorry can only provide a quick response now, but it was only recently added 3 features that relate to your use case;
1. Duel Stream Support (there are guides here with some critical settings such as aligning frame rates between main and sub-streams)
2. They later added the ability to "scale\resize the JPEG" within BI
3. There was an update that changed so that in a dual Stream setup, the JPEGS come automatically now from the main stream (originally they were from the sub stream)
I have used the clone setup before, and it does work quite well, so nothing against it, just more complex.

For you other question, I am still learning but I am using "1272x720". I am using the GPU version (6 instances) and have no resource issues so no point in going lower. I was actually thinking of going back to 1080p to increase the Quality of my Telegram alerts.
 

JL-F1

n3wb
Joined
Jun 12, 2020
Messages
14
Reaction score
2
Location
USA
AiTool--->cameras--->actions/settings--->'cooldown time'

Does the camera cooldown setting only come into effect when their is a positve result and the URL is called? or is it on any analyzed jpg?

I would like to set it to the min length I have my triggered HD recordings going, to help eliminate extra analyses
 
Last edited:

astroshare

Young grasshopper
Joined
Dec 18, 2020
Messages
35
Reaction score
13
Location
usa
AiTool--->cameras--->actions/settings--->'cooldown time'

Does the camera cooldown setting only come into effect when their is a positve result and the URL is called? or is it on any analyzed jpg?

I would like to set it to the min length I have my triggered HD recordings going, to help eliminate extra analyses
I believe it's after a positive detection it goes into timeout.
 

Sireone

Young grasshopper
Joined
Jul 29, 2016
Messages
32
Reaction score
5
This writeup has a way to get the exact JPG (that AI triggered on) . He customized the AI app to give additional settings.
Adding &jpeg=[ImagePathEscaped] to the trigger URL copies the AI image to the BI Alerts folder. BI then uses this image for it's alert email action.

I'm glad I'm doing this as there's no way I would be staying up at 1am adjusting confidence levels after determining that my umbrella is NOT a cat!

FrontDoor.20210113_190813.112978.19.jpg
 

joshwah

Getting the hang of it
Joined
Apr 25, 2019
Messages
184
Reaction score
89
Location
australia
Anyone know what these errors mean when compiling?


Code:
1>------ Build started: Project: UI, Configuration: Debug Any CPU ------
1>CSC : error CS1617: Invalid option '8.0' for /langversion. Use '/langversion:?' to list supported values.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 

astroshare

Young grasshopper
Joined
Dec 18, 2020
Messages
35
Reaction score
13
Location
usa
Adding &jpeg=[ImagePathEscaped] to the trigger URL copies the AI image to the BI Alerts folder. BI then uses this image for it's alert email action.

I'm glad I'm doing this as there's no way I would be staying up at 1am adjusting confidence levels after determining that my umbrella is NOT a cat!

View attachment 79695
This doesn't work 100% of the time (at least with SMS notifications). I was playing around with it, and the same camera would sometimes use the snapshot from AITOOL and others the one from BI.
I'm using BI 5.3.8.3

Screen Shot 2021-01-15 at 9.04.04 PM.png
 

spammenotinoz

Pulling my weight
Joined
Apr 4, 2019
Messages
172
Reaction score
106
Location
Sydney
Adding &jpeg=[ImagePathEscaped] to the trigger URL copies the AI image to the BI Alerts folder. BI then uses this image for it's alert email action.

I'm glad I'm doing this as there's no way I would be staying up at 1am adjusting confidence levels after determining that my umbrella is NOT a cat!
Wow, this small change has made the Alerts so much more relevant. Thank-you!!
 

goldandy

n3wb
Joined
Feb 26, 2019
Messages
1
Reaction score
0
Location
Moscow Russia
Hi there,
I just configured AI integration with BI and it works great, especially with Telegram notifications.

The only one issue I don't know how to deploy:
I have one camera which I don't want to have Telegram notification while I'm at home. How I can configure to notify me by Telegram only while not at home?
There are profiles in BI which I can use for that, so I can configure different alerts (push/email), but there is nothing same for Telegram notifications from aitools.

Any suggestion?

I tried to use this fork:
but I cant use Alert images from aitools in that case

Thanks!
 

Brendon06

Young grasshopper
Joined
Jan 20, 2019
Messages
33
Reaction score
16
Location
New Zealand
Hi there,
I just configured AI integration with BI and it works great, especially with Telegram notifications.

The only one issue I don't know how to deploy:
I have one camera which I don't want to have Telegram notification while I'm at home. How I can configure to notify me by Telegram only while not at home?
There are profiles in BI which I can use for that, so I can configure different alerts (push/email), but there is nothing same for Telegram notifications from aitools.

Any suggestion?

I tried to use this fork:
but I cant use Alert images from aitools in that case

Thanks!
You could set a profile in BlueIris so when you are home it doesn't capture jpeg or alert pic on that particular camera that way ai tool won't process anything
 

spammenotinoz

Pulling my weight
Joined
Apr 4, 2019
Messages
172
Reaction score
106
Location
Sydney
Hi there,
I just configured AI integration with BI and it works great, especially with Telegram notifications.

The only one issue I don't know how to deploy:
I have one camera which I don't want to have Telegram notification while I'm at home. How I can configure to notify me by Telegram only while not at home?
There are profiles in BI which I can use for that, so I can configure different alerts (push/email), but there is nothing same for Telegram notifications from aitools.

Any suggestion?
Actually, this was working fine for myself with the original, but doesn't work for me with the Vorlon version. (Will re-test with the beta).
When it was working, I had a different recording path in BI when I was away, and in AI Tools created duplicate camera (Different Name) set to look at the AWAY path with the Telegram option enabled.
Do note that for AI Tool to still Trigger BI, you can't use the [CAM] variable, you need to manually put the correct camera name in he URL.

Anyway what is happening in the Vorlon version, is it only processed against the first path, seems to be completely confused and never analyses a single image in the AWAY path.
Will re-test with the Beta and Advise,
 

spammenotinoz

Pulling my weight
Joined
Apr 4, 2019
Messages
172
Reaction score
106
Location
Sydney
Actually, this was working fine for myself with the original, but doesn't work for me with the Vorlon version. (Will re-test with the beta).
When it was working, I had a different recording path in BI when I was away, and in AI Tools created duplicate camera (Different Name) set to look at the AWAY path with the Telegram option enabled.
Do note that for AI Tool to still Trigger BI, you can't use the [CAM] variable, you need to manually put the correct camera name in he URL.

Anyway what is happening in the Vorlon version, is it only processed against the first path, seems to be completely confused and never analyses a single image in the AWAY path.
Will re-test with the Beta and Advise,
I re-tested with the Vorlon Beta version, and it still didn't work. (AI tool detects the images in the away path, but always processes them against the original CAM name)???

"This isn't recommended and will lead to other issues", but I even tried changing the Recording Name in BI settings to (ie: Adding an "A" for away and "H" for home in the Name and updating the Paths in AI Tool to commence with
&CAM.A.%Y%m%d_%H%M%S%t
&CAM.H.%Y%m%d_%H%M%S%t
BI functioned correctly,

After updating the paths AI Tool and restarting, but alas, AI Tool detects the images in the new path, but again processed against the old camera. (ie: When away, AI Tool logs show it processes the correct AWAY file names, but processes against the ORIGINAL cam name.

Cloning cameras with completely different names would also work. It's probably due to the way the Vorlon version stores the config in a database, can't have different cameras starting with the Same Name, where this isn't a problem for Gentle Pumpkin's Version.

Even tried deleting the original CAM. I am thinking perhaps if I blow away the entire AI_Tool setup, and add the Cams with the .A and .H suffixes that may work, as creating without these (using defaults) may have done something funny in the Database. Note: AT Tool Camera Name and BI Camera Names within AI Tool were tested with made up values to be sure there wasn't a conflict...:)
 

Sireone

Young grasshopper
Joined
Jul 29, 2016
Messages
32
Reaction score
5
This doesn't work 100% of the time (at least with SMS notifications). I was playing around with it, and the same camera would sometimes use the snapshot from AITOOL and others the one from BI.
I'm using BI 5.3.8.3

View attachment 79721
Yep, I noticed the same thing. Though, when I check the BI Alerts folder, all images there are AI Tool images with overlays. Seems that BI is not grabbing the Alert images at random times.
 
Joined
Jan 13, 2021
Messages
2
Reaction score
0
Location
Fl
I am recieving this error now. Does anyone know how to fix this?

17.01.2021, 19:29:54.618]: read config
[17.01.2021, 19:29:54.628]: add
[17.01.2021, 19:29:54.629]: SUCCESS: cam1 loaded.
[17.01.2021, 19:29:54.651]: Cleaning cameras/history.csv if neccessary...
[17.01.2021, 19:29:54.654]: Loading history list from cameras/history.csv ...
[17.01.2021, 19:29:54.669]: APP START complete.
[17.01.2021, 19:30:58.606]:
[17.01.2021, 19:30:58.607]: Starting analysis of C:\BlueIris\aii\Cam1.20210117_193058539.jpg
[17.01.2021, 19:30:58.622]: (1/6) Uploading image to DeepQuestAI Server
[17.01.2021, 19:31:18.270]: Loading time line from cameras/history.csv ...
[17.01.2021, 19:31:18.273]: Loading confidence-frequency chart from cameras/history.csv ...
[17.01.2021, 19:31:24.197]: Loading time line from cameras/history.csv ...
[17.01.2021, 19:31:24.199]: Loading confidence-frequency chart from cameras/history.csv ...
[17.01.2021, 19:32:38.660]: System.Threading.Tasks.TaskCanceledException | A task was canceled. (code: -2146233029 )
[17.01.2021, 19:32:38.661]: ERROR: Processing the following image 'C:\BlueIris\aii\Cam1.20210117_193058539.jpg' failed. Can't reach DeepQuestAI Server at .
[17.01.2021, 19:32:38.663]:
[17.01.2021, 19:32:38.663]: Starting analysis of C:\BlueIris\aii\Cam1.20210117_193101539.jpg
[17.01.2021, 19:32:38.664]: (1/6) Uploading image to DeepQuestAI Server
[17.01.2021, 19:34:18.668]: System.Threading.Tasks.TaskCanceledException | A task was canceled. (code: -2146233029 )
[17.01.2021, 19:34:18.669]: ERROR: Processing the following image 'C:\BlueIris\aii\Cam1.20210117_193101539.jpg' failed. Can't reach DeepQuestAI Server at .
 

spammenotinoz

Pulling my weight
Joined
Apr 4, 2019
Messages
172
Reaction score
106
Location
Sydney
You could set a profile in BlueIris so when you are home it doesn't capture jpeg or alert pic on that particular camera that way ai tool won't process anything
Okay managed to get this to work, but it is a bit tricky.

So in Blue Iris I modified the JPEG path as follows;
a) Added an extra digit after &CAM to distinguish which profile is in-use, eg: A for AWAY, and H for HOME.
b) Added .&CAM at the end as BI requires the file to start with &CAM. or end with .&CAM or it won't apply the settings.
Note: If you add a digit after the CAM., in the beta testing it was causing issues.
eg; My JPEG snapshot name is "&CAM.H%Y%m%d_%H%M%S%t" for my Actove (HOME) profile and and &CAM.A%Y%m%d_%H%M%S%t when I am away.
With this, no need to modify the path, both profiles can use the same BI Folder, no issue as the FileNames are different.

If your BI Camera is "DriveLow", in AI Tools, I create two Cameras called DriveLowA and DriveLowB.
Do not create a camera called "DriveLow" or AI Tools got confused. Even if the Starts with is unique and different.

Then I set the AI Tool Camera Name, BI Camera Name and Input File Begins With "DriveLowA" and "DriveLowB" respectively.
Then configure each as required. Custom mask can be DriveLow on both to share the same mask file.
On the trigger command, I replace the [CAM] with the Real BI Camera Name, eg: DriveLow. With more testing could find that both cams could use DriveLow as the BlueIris camera name, but this seems to be a new variable and wasn't sure exactly where\how it is used.

This allows myself to have Telegram Alerts only when Away, while still having AI Tools flag the clips when home. So it's not the most elegant but works.

You can also use the &PROFILE variable in BI for it to use the profile number. That can be a cleaner way if your cams are set to copy profiles\settings ect from a master.
 
Last edited:

astroshare

Young grasshopper
Joined
Dec 18, 2020
Messages
35
Reaction score
13
Location
usa
Okay managed to get this to work, but it is a bit tricky.

So in Blue Iris I modified the JPEG path as follows;
a) Added an extra digit after &CAM to distinguish which profile is in-use, eg: A for AWAY, and H for HOME.
b) Added .&CAM at the end as BI requires the file to start with &CAM. or end with .&CAM or it won't apply the settings.
Note: If you add a digit after the CAM., in the beta testing it was causing issues.
eg; My JPEG snapshot name is "&CAM.H%Y%m%d_%H%M%S%t" for my Actove (HOME) profile and and &CAM.A%Y%m%d_%H%M%S%t when I am away.
With this, no need to modify the path, both profiles can use the same BI Folder, no issue as the FileNames are different.

If your BI Camera is "DriveLow", in AI Tools, I create two Cameras called DriveLowA and DriveLowB.
Do not create a camera called "DriveLow" or AI Tools got confused. Even if the Starts with is unique and different.

Then I set the AI Tool Camera Name, BI Camera Name and Input File Begins With "DriveLowA" and "DriveLowB" respectively.
Then configure each as required. Custom mask can be DriveLow on both to share the same mask file.
On the trigger command, I replace the [CAM] with the Real BI Camera Name, eg: DriveLow. With more testing could find that both cams could use DriveLow as the BlueIris camera name, but this seems to be a new variable and wasn't sure exactly where\how it is used.

This allows myself to have Telegram Alerts only when Away, while still having AI Tools flag the clips when home. So it's not the most elegant but works.

You can also use the &PROFILE variable in BI for it to use the profile number. That can be a cleaner way if your cams are set to copy profiles\settings ect from a master.
Great write up, however, I cant get AITOOL to match the .jpeg to a camera. Here's some screenshots.

Jpeg config:
Screen Shot 2021-01-17 at 10.32.56 PM.png

AItool Camera config:
Screen Shot 2021-01-17 at 10.33.16 PM.png

Error on AITOOL
Screen Shot 2021-01-17 at 10.35.59 PM.png
 

spammenotinoz

Pulling my weight
Joined
Apr 4, 2019
Messages
172
Reaction score
106
Location
Sydney
Great write up, however, I cant get AITOOL to match the .jpeg to a camera. Here's some screenshots.

Jpeg config:
View attachment 79848

AItool Camera config:
View attachment 79847

Error on AITOOL
View attachment 79846
Cam name needs to have a character added before the first ".", see my example", I noted in BLUE that for my home profile I added the H and the .&CAM at the end so the new string is;
&CAMH.%Y%m%d_%H%M%S%t.&CAM

The only reason I add ".&CAM" at the end is to allow Blue Iris to save the settings, as I noted above if the character is after the "." it won't be recognised by AI Tool.

1610950256229.png1610950653319.png

Here are the settings I am using in the AI Tool (Noting for the same camera I have another Camera called DriveLowA for when away.
1610951087292.png
1610951108302.png


I have no doubt, that someone smarter will find a more efficient way, but it is working.
 
Last edited:

minigranis

n3wb
Joined
Feb 17, 2018
Messages
5
Reaction score
3
I have Home assistant doing my precence detection (ie home or away) and Home assistant turns the entire motion detection in BI on or off with MQTT. Camera is always recording so I can still review the recorded material if I need. But ofcourse that means setting up Home Assistant as well.
 
Top