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

@cjowers
My understanding is that if you are using a camera without a clone it is envisaged you will be continously recording. Presently I believe you still need a clone to trigger the record.

Thanks Village Guy,

hmm, I do use a copied BI camera stream (which I assume is the 'clone'?); and I suppose I could set up more BI clones (or adjust existing) using the alerts on (based on motion zones), and possibly point the alert folder to my AI tool input folder? it might get a little messy.
Alternatively, I could add the zones to the individual camera configs, and use the built in camera motion trigger, but BI motion seems nicer (and just a guess, more capable).

I always continuously record, so I'm only using this tool to save and review jpeg snapshots and setup some notifications (and of coarse, general tinkering).
 
Thanks Village Guy,

hmm, I do use a copied BI camera stream (which I assume is the 'clone'?); and I suppose I could set up more BI clones (or adjust existing) using the alerts on (based on motion zones), and possibly point the alert folder to my AI tool input folder? it might get a little messy.
Alternatively, I could add the zones to the individual camera configs, and use the built in camera motion trigger, but BI motion seems nicer (and just a guess, more capable).

I always continuously record, so I'm only using this tool to save and review jpeg snapshots and setup some notifications (and of coarse, general tinkering).

Yes my term clone refers to a copied camera. Since you are recording continuously I'm guessing you have no need of clone cameras. Not sure about pointing alerts to your AI Tool folder as you could end up with an infinite loop of triggering.
 
Last edited:
Can anyone explain the masks in v1.67 AI tool?

I'd like to add one over a tree which looks like a person. But I don't see how to achieve this.

And is there a way to only trigger jpeg capture from a specific motion zone in BI? Looks like I can only use the zones to trigger the alert actions, not snapshot record...?

Basically in BI, take a snapshot from the camera you want to add a mask to. Then open that in Paint.net (free software). E.g.

1596455324279.png

Click "add new layer"

Increase the brush width to say 20 to 40 (if you have a lot to mask, obviously the wider the brush the better).

Click on the Colors tab on the screen and "More". Select a color (say dark blue), then select Opacity and choose say 30.

Color in the area you want the AITool/Deepstack to ignore with the brush.

Once done, click "go to layer below", then "Delete layer".

All you should be left with is something like this, which you then save as a "png" file into your "cameras" folder where your AITool is saved, and call it the same as the camera name in BI (you'll also see a .txt document file in that same folder with the same name).

1596455383226.png

When you open up AITools, if something is detected and it's in a masked area, the tool will show it. Eg., there is a lamp post across the street that Deepstack always sees as a person for some reason, and I want to mask that plus the road given I get motion triggers for car lights on my driveway that cause a motion trigger. So when AITools gets the picture from BI and then Deepstack analyses it and sends it back to AITools, if what Deepstack "sees" is in a masked area, it doesn't trigger my cameras even if it is listed as a "person" but in a masked area.

In the below shot on the left you can see it detects a "person", which in this case is the "4" in the time for some reason. But because I have that area masked it won't cause a trigger. If you look closely you can see in the middle pic below I've clicked "Show mask" and you'll notice I have masked the upper part of the picture from the edge of the driveway. I.e., see how the grass is a shade darker as is the sunlight on the street, I've used a grey color with an opacity of around 25 IIRC and masked the entire upper area.

I also copied the snip of what was left from Paint.net that I saved (the png snip I took doesn't perfectly line up to the snips from the AITool of the camera feed, but that gives you an idea of what it looks like after you delete the bottom layer).

1596455632586.png1596455653933.png1596455979052.png
 
Last edited:
Anyone have issues with DeepStack detection at night? A few times I week I review everything given to deepstack at night and every time a skunk comes around it completely misses it. Not even 50% cat, which I would expect. Cats are picked up in the daytime without trouble. I dont check every night, so I wonder what else it has been missing. I cant remember the last animal it detected at night since I started using AI Tool / Deepstack. As you can see, two different cameras/models, and the AI is catching the chairs it always does.

It was able to get a human on one of the same cameras at night last week, but a while back when I walked around the edge of the camera vision range it normally picks up in the day, it didnt get most of me walking around my 3 cameras.

Annotation 2020-08-03 102750.png


Annotation 2020-08-03 102443.png
 
  • Like
Reactions: djernie
i7-6700, so should have avx.
I got avx working on my i7 8700 but I had to enable some options in the bios like Hyperthreading and Trusted execution.Virtualization was already enabled . I don't know which option got it to work. But I still get the little boxes when starting deepquest. However I ran it overnight and it is still working. So maybe a red herring. My CPU is very low like 4-7% now and when processing max 25% but I only run 3 cams 1 4K and 2 2MP. However even with the low cpu load my times in deepquest is 800ms to 1.6 secs. I tried lowering the resolution in BI from 100% to 50% but only a small difference. I don't have the res change in BI yet. Everything running on a Dell Optiplex 7060 i 7 8700
 
@Chris Dodge the contrast is awful in that night time pic Soni surprise really that it can’t make out the skunk.

Great, thanks. If I mess with camera contrast too much it messes with daytime view, but can tweak a little. Also going to try running Deepstack in "HIGH" mode.
Also, I have an extra IR light behind the camera, maybe its just too much for it to handle at night. Will try disabling.
 
I have added another project to GitHub that may be useful. It is inspired by the project here, but adds some new/different features. This is a first release. If there is general interest it will be enhanced in the future. Here is the link: Ken98045/On-Guard
 
  • Like
Reactions: djernie
Basically in BI, take a snapshot from the camera you want to add a mask to. Then open that in Paint.net (free software). E.g.

View attachment 67919

Click "add new layer"

Increase the brush width to say 20 to 40 (if you have a lot to mask, obviously the wider the brush the better).

Click on the Colors tab on the screen and "More". Select a color (say dark blue), then select Opacity and choose say 30.

Color in the area you want the AITool/Deepstack to ignore with the brush.

Once done, click "go to layer below", then "Delete layer".

All you should be left with is something like this, which you then save as a "png" file into your "cameras" folder where your AITool is saved, and call it the same as the camera name in BI (you'll also see a .txt document file in that same folder with the same name).

View attachment 67920

When you open up AITools, if something is detected and it's in a masked area, the tool will show it. Eg., there is a lamp post across the street that Deepstack always sees as a person for some reason, and I want to mask that plus the road given I get motion triggers for car lights on my driveway that cause a motion trigger. So when AITools gets the picture from BI and then Deepstack analyses it and sends it back to AITools, if what Deepstack "sees" is in a masked area, it doesn't trigger my cameras even if it is listed as a "person" but in a masked area.

In the below shot on the left you can see it detects a "person", which in this case is the "4" in the time for some reason. But because I have that area masked it won't cause a trigger. If you look closely you can see in the middle pic below I've clicked "Show mask" and you'll notice I have masked the upper part of the picture from the edge of the driveway. I.e., see how the grass is a shade darker as is the sunlight on the street, I've used a grey color with an opacity of around 25 IIRC and masked the entire upper area.

I also copied the snip of what was left from Paint.net that I saved (the png snip I took doesn't perfectly line up to the snips from the AITool of the camera feed, but that gives you an idea of what it looks like after you delete the bottom layer).

View attachment 67921View attachment 67922View attachment 67924
Very nice writeup!
 
  • Like
Reactions: Cameraguy
Anyone have issues with DeepStack detection at night? A few times I week I review everything given to deepstack at night and every time a skunk comes around it completely misses it. Not even 50% cat, which I would expect. Cats are picked up in the daytime without trouble. I dont check every night, so I wonder what else it has been missing. I cant remember the last animal it detected at night since I started using AI Tool / Deepstack. As you can see, two different cameras/models, and the AI is catching the chairs it always does.

It was able to get a human on one of the same cameras at night last week, but a while back when I walked around the edge of the camera vision range it normally picks up in the day, it didnt get most of me walking around my 3 cameras.

Yea, I agree the animal detection seems pretty bad. Dog detection stats on my setup is probably 0/100 so far this week. Different dogs, day or night, doesn't get any of them. I was thinking it was due to the camera height / downward looking angle (similar to yours), if they have perhaps trained the model on mostly images from the animal's height. As far as I know, deepstack isnt just for IP cams, and I imagine it wasn't trained with IP cam datasets.

Not sure what cams you have, but most have separate day/night contrast settings no?


Anyone tried the deepstack face detection api? Would be cool to teach it your own face, if you had a close up entry cam or similar. even if it's just to ignore any alerts with yourself or family in it. I know they aren't perfect, but even the newer phone facial recognition stuff is pretty decent.
 
Basically in BI, take a snapshot from the camera you want to add a mask to. Then open that in Paint.net (free software). E.g.

Amazing, thanks @pbc!

Wish camera hardware had this level of masking available. One of my camera's gets too much IR light from the wall it's on, and was giving it occasional seizures. low exposure and a few stickers on the lens have helped
 
Could we have an option to manage the log file? Something like close the current and create a new every week or open a new log file based on the day of the week and simply overwrite tuesday if it already exists? That way you'd have the logs for the last 6-7 days before each day gets overwritten. Currently my log file just gets way too long as I forget to go in and stop the AITools service and zero down the file.
 
Could we have an option to manage the log file? Something like close the current and create a new every week or open a new log file based on the day of the week and simply overwrite tuesday if it already exists? That way you'd have the logs for the last 6-7 days before each day gets overwritten. Currently my log file just gets way too long as I forget to go in and stop the AITools service and zero down the file.

Here is my fork with a bunch of enhancements if you would like to try it. Including DeepStack start/stop control (Windows version only) and a number of logging enhancements such as rotating out a main log file and deleting them after 60 days. Prob should lower that number and make it configurable though.

Backup the current folder and overwrite all the existing files. It will read the old settings and camera configuration.
 
Yes I can add a switch to turn off sending the image along.

regarding the Raspberry and the Compute stick: what are the processing times each?

Is this an option now? I would love to be have the image with object detection overlay boxes sent to telegram instead of the clean original image.
 
Could we have an option to manage the log file? Something like close the current and create a new every week or open a new log file based on the day of the week and simply overwrite tuesday if it already exists? That way you'd have the logs for the last 6-7 days before each day gets overwritten. Currently my log file just gets way too long as I forget to go in and stop the AITools service and zero down the file.

There is no need to close AiTools to clear the log. Just open the log as usual, select all in the editor and then delete and finally save. All done ;)
 
There is no need to close AiTools to clear the log. Just open the log as usual, select all in the editor and then delete and finally save. All done ;)

The reason I do as stated is that AITools is still running and expects to be able to write to the log, with the log open in notepad it’s locked so i just prefer to make sure that I don’t cause issues.
 
Here is my fork with a bunch of enhancements if you would like to try it. Including DeepStack start/stop control (Windows version only) and a number of logging enhancements such as rotating out a main log file and deleting them after 60 days. Prob should lower that number and make it configurable though.

Backup the current folder and overwrite all the existing files. It will read the old settings and camera configuration.

Thanks I’ll give it a go over the weekend and report back
 
Hey there. Wanted to see if anyone knew if the docker container install type runs as a service? I didn't seem to when i tried. I rebooted, logged in, and docker was just starting up again. Is there an EASY way to run it as a service in windows? Thanks
 
Hey there. Wanted to see if anyone knew if the docker container install type runs as a service? I didn't seem to when i tried. I rebooted, logged in, and docker was just starting up again. Is there an EASY way to run it as a service in windows? Thanks

Sounds like it is running as a service if after rebooting per your message above "docker was just starting up again" after you logged in?

That's how it works on my install.

Alternatively if you right click on the whale icon in the bottom right, click settings. Should have a check mark next to "start docker desktop when you log in"