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

pbc

Getting comfortable
Joined
Jul 11, 2014
Messages
1,024
Reaction score
156
Anyhow, switched over to noavx for now. Anyone know why my timezone command isn't working?

Code:
docker run --restart=always -e TZ=America/Toronto -e VISION-DETECTION=True -v localstorage:/datastore -p 81:5000 --name deepstack deepquestai/deepstack:noavx
Should show 9:57pm below vs 1:57..

1596419845225.png
 

cjowers

Getting the hang of it
Joined
Jan 28, 2020
Messages
107
Reaction score
36
Location
AUS
UTC time format maybe? The AITool should probably have it formatted for your time zone I would think.

pbc, did you try installing any nvidea gpu drivers for this?
or maybe try '--rm --runtime=nvidia' argument?
docker run --rm --runtime=nvidia -e VISION-DETECTION=True -v localstorage:/datastore -p 81:5000 deepquestai/deepstack:gpu

Didn't work for me, but you never know.... as mentioned earlier, linux is recommended

Seems the deepstack gpu version only runs on linux right now.

Using DeepStack with NVIDIA GPU — DeepStack 0.1 documentation
pdf here:
 
Last edited:

cjowers

Getting the hang of it
Joined
Jan 28, 2020
Messages
107
Reaction score
36
Location
AUS
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...?
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
@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.

I drove myself crazy trying to make a single camera work in the same way as my clone configuration. IMHO It's unfortunate that this restriction is not made clear in the setup instructions.

@GentlePumpkin
If my take above is correct it might be useful to add a note to the setup guide clarifying this point.

Thanks for all the work you have put into aitools.
 

cjowers

Getting the hang of it
Joined
Jan 28, 2020
Messages
107
Reaction score
36
Location
AUS
@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).
 

Village Guy

Pulling my weight
Joined
May 6, 2020
Messages
291
Reaction score
161
Location
UK
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.
 

pbc

Getting comfortable
Joined
Jul 11, 2014
Messages
1,024
Reaction score
156
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:

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
90
Reaction score
114
Location
massachusetts
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
 

eman

n3wb
Joined
Aug 21, 2017
Messages
21
Reaction score
3
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

Pulling my weight
Joined
Aug 9, 2019
Messages
90
Reaction score
114
Location
massachusetts
@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.
 

Ken98045

IPCT Contributor
Joined
Aug 3, 2020
Messages
219
Reaction score
74
Location
Seattle
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
 

GentlePumpkin

IPCT Contributor
Joined
Sep 4, 2017
Messages
193
Reaction score
321
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!
 

cjowers

Getting the hang of it
Joined
Jan 28, 2020
Messages
107
Reaction score
36
Location
AUS
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.
 

cjowers

Getting the hang of it
Joined
Jan 28, 2020
Messages
107
Reaction score
36
Location
AUS
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
 

IAmATeaf

Known around here
Joined
Jan 13, 2019
Messages
3,287
Reaction score
3,252
Location
United Kingdom
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.
 

Chris Dodge

Pulling my weight
Joined
Aug 9, 2019
Messages
90
Reaction score
114
Location
massachusetts
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.
 

TaylorTech

n3wb
Joined
Sep 29, 2018
Messages
3
Reaction score
1
Location
46368
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.
 
Top