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

robpur

Young grasshopper
Joined
Jul 31, 2014
Messages
47
Reaction score
16
Location
Washington State
So robpur I was having a similar issue but want to clarify before I give you bad info on what I did 1. the "4th" camera is actually loaded just throwing errors or 2. You can only add 3 total cameras to the system?
If three of my cameras are set up in AI Tool then everything works correctly. If I add a fourth camera in AI Tool everything works correctly until the fourth camera sees motion. After that AI Tool stops sending images to DS.

I've reported the issue on Gethub and have been pointed to a development version of AI Tool that has a very different way of adding DS URLs but I haven't had time to try it yet.
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
141
Reaction score
23
Location
TX
If three of my cameras are set up in AI Tool then everything works correctly. If I add a fourth camera in AI Tool everything works correctly until the fourth camera sees motion. After that AI Tool stops sending images to DS.

I've reported the issue on Gethub and have been pointed to a development version of AI Tool that has a very different way of adding DS URLs but I haven't had time to try it yet.
Ok. I was having a similar issue however I have 8 cameras, I can't say for sure because I didn't put 2&2 together until I read your post, but with me I added a new camera which was a Reolink, after I added it in BI, I noticed in AI-Tool the trigger statement had been added automatically and was different than all my others, again I did not add it it just was there, I left it alone B/C I was getting alerts in Telegram but that is when I started getting the same error as you, I changed the trigger on the Reolink to match all the other cameras and I didn't see the error anymore. *** But I was having unrelated computer issues on my BI box and during the same time I did a clean install and started over, I did change all the triggers AFTER the re install also and I have not seen the error since. My explanation /(maybe) answer could be wrong but you may want to check it and see if it helps.
 

robpur

Young grasshopper
Joined
Jul 31, 2014
Messages
47
Reaction score
16
Location
Washington State
Ok. I was having a similar issue however I have 8 cameras, I can't say for sure because I didn't put 2&2 together until I read your post, but with me I added a new camera which was a Reolink, after I added it in BI, I noticed in AI-Tool the trigger statement had been added automatically and was different than all my others, again I did not add it it just was there, I left it alone B/C I was getting alerts in Telegram but that is when I started getting the same error as you, I changed the trigger on the Reolink to match all the other cameras and I didn't see the error anymore. *** But I was having unrelated computer issues on my BI box and during the same time I did a clean install and started over, I did change all the triggers AFTER the re install also and I have not seen the error since. My explanation /(maybe) answer could be wrong but you may want to check it and see if it helps.
You may be on to something there. I just checked and I see that I made a stupid mistake. In older versions of AI Tool the trigger line was out in the open where you could see it. Now you have to click on the Settings button next to Actions before entering the Trigger URLs. When setting up the new camera I forgot all about the trigger URL and didn't enter my user name and password. I just fixed the line but I'm not at home and therefore can't do a walk test. I'll give it a try after work. Thanks for the tip!
 

CAL7

n3wb
Joined
Nov 26, 2020
Messages
19
Reaction score
7
Location
Florida
I endorse the Dane Creek notes. As a total newbie, I found his hints to be very helpful. His process is 95% from The Hookup video, but he incorporates some newer techniques since the video was produced.

... do not clone these cameras because if you did then you would have both "enable motion detector" and "direct to disk recording" and you don't need that on the HD streams.
@Ripper99 Would you please clarify "clone" terminology? Following The Hookup video, I set mine with one camera using the HD mainstream and a second that uses the low-res substream as its mainstream. I believe everything is working as I intended, i.e. the low-res records continuously and uses motion detection (with AITOOL & Deepstack) to trigger the HD camera. From your comment I quoted above, do I interpret this as NOT a cloned camera setup?
 

austwhite

Getting the hang of it
Joined
Jun 7, 2020
Messages
74
Reaction score
56
Location
Australia/Melbourne
When you followed the tutorial by The Hookup have "enable motion detector" and "direct to disk recording" as options for your substream cameras however later in the video for the HD stream cameras that will produce recordings based on triggers you do not clone these cameras because if you did then you would have both "enable motion detector" and "direct to disk recording" and you don't need that on the HD streams.

Watch the video here and you do NOT want motion selected on HD stream cameras and if you are cloning from other cams you will have that. I followed the video The Hookup has and have Deepstack running in docker on a ESXI server and then I have BlueIris and AItool running on the same machine with 14 cameras and everything seems to work fine and trigger right away, I also reviewed this guys notes to confirm everything
I didn't mean clone as in cloning with in BLue Iris, I meant duplicate camera. Either way, the issue I have is not excessive motion detection, it is delayed processing of the motion. The whole thing works as expected, except it takes 5 seconds before the first motion event triggers the HD recording.

Sorry for the confusion of terms
 

austwhite

Getting the hang of it
Joined
Jun 7, 2020
Messages
74
Reaction score
56
Location
Australia/Melbourne
I endorse the Dane Creek notes. As a total newbie, I found his hints to be very helpful. His process is 95% from The Hookup video, but he incorporates some newer techniques since the video was produced.



@Ripper99 Would you please clarify "clone" terminology? Following The Hookup video, I set mine with one camera using the HD mainstream and a second that uses the low-res substream as its mainstream. I believe everything is working as I intended, i.e. the low-res records continuously and uses motion detection (with AITOOL & Deepstack) to trigger the HD camera. From your comment I quoted above, do I interpret this as NOT a cloned camera setup?
@Ripper99 is correct. My use of the word "clone" was not actually a clone camera. Blue Iris has a function for cloning a camera. What Rob (and myself and others following the same process) are doing is actually creating a new camera in Blue Iris with just the substream for the detection and 24/7 recording. A true clone camera would be cloned within BI with identical streams to the original camera. This would not work for Rob's 24/7 stream as the HD of the clone would be recorded 24/7. A clone would only be used if you are only recording motion events the AITool flags.
I will use the clone option for my indoor cameras when I set them up as they do not need to record 24/7.
 
Last edited:

robpur

Young grasshopper
Joined
Jul 31, 2014
Messages
47
Reaction score
16
Location
Washington State
Ok. I was having a similar issue however I have 8 cameras, I can't say for sure because I didn't put 2&2 together until I read your post, but with me I added a new camera which was a Reolink, after I added it in BI, I noticed in AI-Tool the trigger statement had been added automatically and was different than all my others, again I did not add it it just was there, I left it alone B/C I was getting alerts in Telegram but that is when I started getting the same error as you, I changed the trigger on the Reolink to match all the other cameras and I didn't see the error anymore. *** But I was having unrelated computer issues on my BI box and during the same time I did a clean install and started over, I did change all the triggers AFTER the re install also and I have not seen the error since. My explanation /(maybe) answer could be wrong but you may want to check it and see if it helps.
Did a test and the trigger was the issue. All four of the cameras are working with AI now. It was a dumb mistake that cost me time and effort. I guess I wasn't balicudb at the moment :)

As mentioned the development version of AI Tool has a different way of specifying AI server URLs. It looks like not only can you add multiple servers as you could before, but you can also associate cameras with specific servers. We haven't seen an official AI Tool release for a while but it's good to know that progress is being made and good things are on the way. The development version supports AWS Rekognition Server and DOODS AI Server as well as DeepStack.

1609196565240.png
 

CAL7

n3wb
Joined
Nov 26, 2020
Messages
19
Reaction score
7
Location
Florida
@Ripper99 is correct. My use of the word "clone" was not actually a clone camera. Blue Iris has a function for cloning a camera. What Rob (and myself and others following the same process) are doing is actually creating a new camera in Blue Iris with just the substream for the detection and 24/7 recording. A true clone camera would be cloned within BI with identical streams to the original camera. This would not work for Rob's 24/7 stream as the HD of the clone would be recorded 24/7.
Thanks @austwhite and @Ripper99 . This was a huge source of confusion to me when I was trying to figure this out, just a couple of weeks ago. It would have save me a ton of time if I had found a simple paragraph like you just gave me.
 
Joined
Nov 20, 2016
Messages
18
Reaction score
1
Can someone help me understand the AITool service? I've set up the service according to the instructions, and it appears to be active. But I'm not sure how to monitor it when running as a service. Is there a way to open the UI so I can look at the history/logs? If I double click and start the program manually, does that create another instance of the program that might interfere with the service, or does it just bring up the UI for the already running program? What is the best way to take a look at the UI when the service is running?
 

robpur

Young grasshopper
Joined
Jul 31, 2014
Messages
47
Reaction score
16
Location
Washington State
Can someone help me understand the AITool service? I've set up the service according to the instructions, and it appears to be active. But I'm not sure how to monitor it when running as a service. Is there a way to open the UI so I can look at the history/logs? If I double click and start the program manually, does that create another instance of the program that might interfere with the service, or does it just bring up the UI for the already running program? What is the best way to take a look at the UI when the service is running?
I don't know if this is still true, but at one time the answer was that you can not view the interface while running as a service, and opening AI Tool while the service is running will open another instance and it can interfere with the service. If things have changed in a later version then I'm sure someone will chime in.

I don't run as a service. My BI machine doesn't have a Windows password so upon reboot it goes directly into Windows and I have AI Tool start automatically. I suppose a disadvantage to not running as a service is that you can not have the service automatically restart or perform some other function if it fails. I use zone crossing at my most critical point just in case AI fails for some reason.
 
Joined
Nov 10, 2020
Messages
6
Reaction score
1
Location
Australia
Afternoon all and thanks for all the work both creating the software and answering questions. I am brand new at all of this, but I am gradually getting the hang of much of it (I think). However, there are a few questions I haven’t really been able to answer, and I’d appreciate it if someone was able to steer me in the correct direction. Please forgive any ignorant terminology!

I have BI5 and VorlonCD’s version of AITool running as a service on a dedicated PC. I also have DeepstackAI (cpu-x3-beta) running within a docker container and it is set to auto restart as per GentlePumpkin’s instructions. My setup consists of 6x Hikvision 4MP ColorVu G1 turrets, and I will soon be adding 3x 4MP ColorVu G1 mini bullets.

Initially I set the cameras up in the HD/SD configuration described in The Hook Up’s post, but it seemed that the motion detection using the SD substream was a bit unreliable at detecting motion. I have since found some info suggesting that the number of pixels travelled to trigger the motion on the lower quality substream may need to be reduced, but I am not sure whether that was my issue. I do like the fact that this setup provides a continuous substream recording, just in case there is something important which was missed (even if the recording quality is poorer).

I then decided to switch to the ‘single camera’ setup explained on the FamilyTechExec’s post. It seems to be working quite well, although I’d prefer it if there was a way to avoid getting recordings that ultimately don’t contain any objects of interest (I am only interested in ‘persons’ on my property).

Questions:
1) I setup DeepstackAI in a docker container using GentlePumpkin’s original instructions. They refer to cpu-x3-beta which is what I ‘pulled’. The Hook Up’s post refers to pulling deepstackai:latest, and the Deepquest website also refers to cpu-x4-beta.

I was wondering whether it would be worth pulling the latest version of DeepstackAI using the ‘latest’ option (or the x4 option I presume)? I could do this and set it up to run on a different port so that in the event I stuff it up I can simply remove it and point AITool back to my currently functioning ‘cpu-x3-beta’ version.

In the event I need to remove a DeepstackAI server, is it simply a matter of deleting it from within the Docker for Windows GUI?

2) Under my current single camera setup, I was originally sending full sized JPGs from the mainstream to the aiinput folder. These files were 2688x1520 and 2-3MB in size. This was causing huge processing delays, so I changed the JPG quality to 50% which has retained the 2688x1520 dimensions but dropped the file to size to 200-600kb (according the JPGs currently sitting in my aiinput folder). Processing time has dropped to the point that the queue doesn’t build up, although if I end up with 9 cameras firing at once, I’m guessing I’ll have an issue.

I have seen recent references to using the BI JPG resize option, so I was wondering whether there is some sort of recommendation as to what sort of dimensions, quality or file size is best for the JPGs which are sent to the aiinput folder for analysis?

3) I have set up motion zones within BI as I initially found that sometimes I was getting headlights rapidly moving across some external walls on my front porch which was triggering the motion detection. I am aware that the masking option within AITool works opposite to BI in that the highlighted areas are areas within which to ignore motion. I haven’t really found any definitive instructions as to how to set up a custom mask. From what I can gather though, I need to trigger the relevant camera so that a JPG is sent to the aiinput folder, then go to the custom mask option within AITool and draw on the areas I want ignored before selecting OK and saving the camera?

Initially I was getting info at the top of the AITool dialog box saying that the camera.bmp file was missing, but I think that was because I was yet to draw the custom mask. I’m presuming the .BMP file refers to the file created by AITool once you’ve defined your custom mask areas?

Apologies for the lengthy post, but I figured it helps explain my questions better.

Thanks in advance.
 

kosh42efg

n3wb
Joined
Aug 14, 2020
Messages
29
Reaction score
13
New guy here. Sorry if this has been explained already - I could not find anything.... :confused:
Looking for AITool / docker HELP running deepquestai/deepstack:gpu and deepquestai/deepstack:latest - the cpu version (latest) works fine in docker (WSL2/Ubuntu). I cannot get the gpu version to receive data from AITool. I configured AI Server URLs as localhost:8383,localhost:8384 for cpu and gpu respectively.
I am getting this error in AITool ...Problem with AI URL: All is running on the same WIN10 PC. Why is the cpu version connecting fine on port 8383 but not the gpu version on port 8384 ???
Thank you for any hints... !
I have it working exactly like this. However I think you need to have a Windows Insider build to enable WSL to access the GPU as per here.
 

kosh42efg

n3wb
Joined
Aug 14, 2020
Messages
29
Reaction score
13
See above...
I did similar to start with. I have evolved now to having this per camera:
  • Low res substream - 24/7 recording with no motion detection.
  • High res main stream that records video when triggered by AITool.
  • A second high res main stream that records JPEG resized to 1280x720 (and not video) on motion detection that saves to the aiinput folder to trigger the tool.
Works well so far, but only a few days in to this way. Like you, the low res image recognition was not good enough.
 

kosh42efg

n3wb
Joined
Aug 14, 2020
Messages
29
Reaction score
13
Odd question. For others running AITool as a server, do you stop the server in Task Manager before opening the AITool program to make changes, see the history, etc?
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
141
Reaction score
23
Location
TX
Afternoon all and thanks for all the work both creating the software and answering questions. I am brand new at all of this, but I am gradually getting the hang of much of it (I think). However, there are a few questions I haven’t really been able to answer, and I’d appreciate it if someone was able to steer me in the correct direction. Please forgive any ignorant terminology.....
]
Questions/Answers:

I will do my best to answer your questions, Since you have not told us the configuration of the computer(s) some of my answers will be based on assumptions, If you have a working set-up make sure and do a back-up, know what version of what you are using etc. so if it does not work you can go back, I am not an expert and there are much smarter folks on here than me but here goes..

1) I setup DeepstackAI in a docker container using GentlePumpkin’s original instructions. They refer to cpu-x3-beta which is what I ‘pulled’. The Hook Up’s post refers to pulling deepstackai:latest, and the Deepquest website also refers to cpu-x4-beta.

A: Unless you are trying something that is in beta I suggest you use deepstackai:latest, since this will give you…well the latest version each time. If you have the ability (I don’t) to use the GPU version I would try that, it seems top be much faster according tohose that use it.

In the event I need to remove a DeepstackAI server, is it simply a matter of deleting it from within the Docker for Windows GUI?

A: Not sure how you set it up, I am Not the guy to answer Docker questions, if you have it living inside a container in Docker then if you deleted that container that would get rid of it as far as I know.



2) Under my current single camera setup, I was originally sending full sized JPGs from the mainstream to the aiinput folder. These files were 2688x1520 and 2-3MB in size. This was causing huge processing delays, so I changed the JPG quality to 50% which has retained the 2688x1520 dimensions but dropped the file to size to 200-600kb (according the JPGs currently sitting in my aiinput folder). Processing time has dropped to the point that the queue doesn’t build up, although if I end up with 9 cameras firing at once, I’m guessing I’ll have an issue.

A: Since I don’t know what your processing times were / are it is hard to tell you how to fix that- “fast processing” is a bit relative fast to me with my ancient Dell optiplex vs fast to you on a custom built machine will be different but the odds of all the cameras firing at one time would be minimal I would think, unless you have them all lined up in a row or you live on busy street or something. There have been folks here that dumped 1000+ images into the AI folder to test the system and it worked just fine, the system will queue the images so they will get checked, with the newest AI-tool changes there is now the ability to use multiple deepstack server address’ plus AWS plus DOODS, you will need to look on Github or compile the latest builds yourself as that part is having daily changes/updates and there a couple different forks, I use the VorlonCD version myself



I have seen recent references to using the BI JPG resize option, so I was wondering whether there is some sort of recommendation as to what sort of dimensions, quality or file size is best for the JPGs which are sent to the aiinput folder for analysis?

A: Not that I am aware of. I do not use that option as it was causing me errors, Not saying it is not possible I just did not mess around with it long enough to see if it would work sans errors.



3) I have set up motion zones within BI as I initially found that sometimes I was getting headlights rapidly moving across some external walls on my front porch which was triggering the motion detection. I am aware that the masking option within AITool works opposite to BI in that the highlighted areas are areas within which to ignore motion. I haven’t really found any definitive instructions as to how to set up a custom mask. From what I can gather though, I need to trigger the relevant camera so that a JPG is sent to the aiinput folder, then go to the custom mask option within AITool and draw on the areas I want ignored before selecting OK and saving the camera?

A: In AI-Tool You use masks to block a item, in BI a motion zone A-B would cause an alert if the “thing” crossed from one zone to the other, maybe I misunderstood you if so then just igmore me. But yes if you went to the camera tab in AI-Tool clicked on draw Mask if no image came up you would need to trigge that camera so one would be the to draw your mask on, if there is one already there then just drive on and mask out the areas you need to, click save and your done. You also have the option (depending on which version you are using) to use Dynamic masking which works very well.

Initially I was getting info at the top of the AITool dialog box saying that the camera.bmp file was missing, but I think that was because I was yet to draw the custom mask. I’m presuming the .BMP file refers to the file created by AITool once you’ve defined your custom mask areas?

A: Correct.
 

seth-feinberg

Young grasshopper
Joined
Aug 28, 2020
Messages
54
Reaction score
4
Low res substream - 24/7 recording with no motion detection.
Thanks for sharing your setup! I was curious, why record 24x7 on the low res if your taking hi-res jpegs from the HD Main stream and motion recording from the HD Main stream?

I currently use the method in the hookup with 24x7 recording from the substream as well as jpegs and then recording the hi-res Main stream when alerts are identified with AITool but I would, at least, like to switch the jpegs to hi-res images to increase accuracy. the dream set up would be hi-res jpegs triggering hi-res motion clips and no substream except to view in small thumbnail in BI to save cpu resources....
 

seth-feinberg

Young grasshopper
Joined
Aug 28, 2020
Messages
54
Reaction score
4
I don't know if this is still true, but at one time the answer was that you can not view the interface while running as a service, and opening AI Tool while the service is running will open another instance and it can interfere with the service. If things have changed in a later version then I'm sure someone will chime in.

I don't run as a service. My BI machine doesn't have a Windows password so upon reboot it goes directly into Windows and I have AI Tool start automatically. I suppose a disadvantage to not running as a service is that you can not have the service automatically restart or perform some other function if it fails. I use zone crossing at my most critical point just in case AI fails for some reason.
I'm not sure if this helps but on the github page i noticed someone mentioning a similar issue to mine, which was related to the original way i set up the service (per the instructions on the first post). I have since migrated to the method VorlonCD mentions in this post: Awesome! Just a question about the service and desktop tool - 2 instances running? · Issue #100 · VorlonCD/bi-aidetection
 

kosh42efg

n3wb
Joined
Aug 14, 2020
Messages
29
Reaction score
13
Thanks for sharing your setup! I was curious, why record 24x7 on the low res if your taking hi-res jpegs from the HD Main stream and motion recording from the HD Main stream?

I currently use the method in the hookup with 24x7 recording from the substream as well as jpegs and then recording the hi-res Main stream when alerts are identified with AITool but I would, at least, like to switch the jpegs to hi-res images to increase accuracy. the dream set up would be hi-res jpegs triggering hi-res motion clips and no substream except to view in small thumbnail in BI to save cpu resources....
The 24/7 recording is in case the AI fails to notice something, as I want something recorded. And I don't want to dedicate disk space resources to storing 24/7 4k streams.
 

ZAPme

n3wb
Joined
Dec 15, 2020
Messages
6
Reaction score
0
Location
USA
I have it working exactly like this. However I think you need to have a Windows Insider build to enable WSL to access the GPU as per here.
Thank you for the hint!
Still no luck with the GPU version. I did read somewhere that the CUDA/gpu version does not support Docker desktop? - is that my issue? Not sure how to run docker in the linux subsystem (Ubuntu).
I went through the steps in the link. Downloaded a ton of packages ... a little beyond me I admit. I did install WSL2 - re-installed docker for desktop. It recognized the WSL2. AITool is still getting the error message when trying to connect to docker gpu.
 

kosh42efg

n3wb
Joined
Aug 14, 2020
Messages
29
Reaction score
13
Thank you for the hint!
Still no luck with the GPU version. I did read somewhere that the CUDA/gpu version does not support Docker desktop? - is that my issue? Not sure how to run docker in the linux subsystem (Ubuntu).
I went through the steps in the link. Downloaded a ton of packages ... a little beyond me I admit. I did install WSL2 - re-installed docker for desktop. It recognized the WSL2. AITool is still getting the error message when trying to connect to docker gpu.
Do you have the technical preview build of Docker? GPU support in Docker Desktop is a new feature not in the main release yet:
 
Top