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

2700 images in around 10 minutes is quite unrealistic as BI will never send that many images that fast to the AI tool for processing, but by throwing that many images at it in a test it created a way to measure the real world processing time in some meaningful way.
I have been doing 260 a minute within AITool.
 
Last edited:
1608845233126.png
Top one is Windows GPU, 2nd is Jetsun, 3rd docker CPU, 4th my laptop docker, 5th docker CPU on another desktop and sixth Amazon. !st and 3rd are on BI machine.


1608845746800.png
 
Last edited:
  • Like
Reactions: maximosm
Biggest issue I have with the GPU version is the 1st image in a series always takes WAY longer. The GPU clock speed is probably way down during that 1st image, then it throttles up and subsequent requests are very fast. Changing the settings in Nvidia Control Panel to Prefer Maximum Performance doesn't help.

[GIN] 2020/12/24 - 16:53:32 | 200 | 397.9982ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:53:38 | 200 | 81.0031ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:53:43 | 200 | 99.004ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:15 | 200 | 136.0008ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:19 | 200 | 84.0018ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:19 | 200 | 164.9922ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:23 | 200 | 138.0019ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:27 | 200 | 138.9995ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:31 | 200 | 125.9976ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:35 | 200 | 162.0054ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:06 | 200 | 44.9992ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:10 | 200 | 127.005ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:14 | 200 | 132.9966ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:17 | 200 | 84.0023ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:19 | 200 | 134.0005ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:00:15 | 200 | 134.0012ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:00:18 | 200 | 128.0008ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:00:22 | 200 | 129.9998ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:54 | 200 | 459.9971ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:55 | 200 | 132.0027ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:59 | 200 | 156.9986ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:59 | 200 | 111.9994ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:36:03 | 200 | 140.9979ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:36:03 | 200 | 109.0036ms | 127.0.0.1 | POST /v1/vision/detection
 
Biggest issue I have with the GPU version is the 1st image in a series always takes WAY longer. The GPU clock speed is probably way down during that 1st image, then it throttles up and subsequent requests are very fast. Changing the settings in Nvidia Control Panel to Prefer Maximum Performance doesn't help.

[GIN] 2020/12/24 - 16:53:32 | 200 | 397.9982ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:53:38 | 200 | 81.0031ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:53:43 | 200 | 99.004ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:15 | 200 | 136.0008ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:19 | 200 | 84.0018ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:19 | 200 | 164.9922ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:23 | 200 | 138.0019ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:27 | 200 | 138.9995ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:31 | 200 | 125.9976ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:54:35 | 200 | 162.0054ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:06 | 200 | 44.9992ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:10 | 200 | 127.005ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:14 | 200 | 132.9966ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:17 | 200 | 84.0023ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 16:55:19 | 200 | 134.0005ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:00:15 | 200 | 134.0012ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:00:18 | 200 | 128.0008ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:00:22 | 200 | 129.9998ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:54 | 200 | 459.9971ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:55 | 200 | 132.0027ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:59 | 200 | 156.9986ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:35:59 | 200 | 111.9994ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:36:03 | 200 | 140.9979ms | 127.0.0.1 | POST /v1/vision/detection
[GIN] 2020/12/24 - 17:36:03 | 200 | 109.0036ms | 127.0.0.1 | POST /v1/vision/detection


That's normal
 
It might be normal, but it kind of defeats the advantages of the GPU version. The time to notification on the 1st image is the most important of the whole "series"
Its only the very first image to be processed . If it's that important do a test image when you first start AITOOL. I have no problems at all because of it. I find the CPU version does it as well, so does the Jetson and the PI.

Sorry I didn't notice the one further down. It's only the very first time deepstack process an image with me after you've started it.
 
Last edited:
For me the delay happens once it hasn't processed an image in about 4 mins.
 
  • Like
Reactions: cscoppa
Just wanted to say Thanks to everyone for all the fabulous work on this! I hope everyone has Safe and Happy Holiday Season! :clap:
 
It might be normal, but it kind of defeats the advantages of the GPU version. The time to notification on the 1st image is the most important of the whole "series"

I've tried to replicate it and it also happens with mine as well. It doesn't happen with the CPU' Docker deepstack but I've not tried it with the Windows CPU version.

I don't think it's creating much of a problem as its less than a half a second difference but I've opened an issue on Github.
 
  • Like
Reactions: cscoppa
Yeah it's doing my head in... it keeps telling me all my URLs are in use....?

I'm currently feeling your pain. I had been running AI Tool and the older Windows version of DS for some time without much trouble. Recently I upgraded to the latest Windows version of DS and added a Nano, again with the latest DS. I also added a fourth camera for use with AI. I didn't notice any trouble between the short time when I upgraded DS and when I added the camera, but I can't say for sure if there was an issue. However, after adding the camera I started getting the message that all URLs were in use and processing would stop. After 100 images collected in the queue then I started getting messages about the queue being full. After restarting AI Tool it would process images for a bit and then fail again.

I monkeyed with things quite a bit in an attempt to get it working again. I removed the new version of DS and went back to the old one. I removed AI Tool and tried starting over again, but it appears that you can't start fresh just by deleting the AI Tool program folder. After doing so and starting AI Tool, my cameras and settings were still there. The log said that the config file was messed up and that it was restoring from the registry. So I suppose there's some AI Tool settings stored in the Windows registry, or at least somewhere other than where AI Tool resides.

So I decided to try an older version of AI Tool. I think it was 1.8 something, but I still had the same problem. So I gave up and did a bare metal restore from a backup and restored to a point before I upgraded to the newer version of DS and before I added the new camera, and then everything worked as expected. Well, until I added the fourth camera. After that I started getting the messages about all the URLs being in use. I removed the new camera and everything worked as expected again.

I was running the latest AI Tool and the older version of Windows DS on my BI machine. In an attempt to see if the new version of DS had something to do with it I pointed AI Tool only to the Nano. It seems to be working well now but I haven't had much time for testing. If it proves to be acting normal for a day or two then I'll try adding in the new camera.

The camera isn't anything fancy. Just a cheap Reolink RLC-410 that I put part way down my long driveway to see when someone is coming. There's a tree that blows in the wind but I have it masked out in a BI motion zone so it doesn't generate a lot of images to be analyzed by AI. It doesn't make sense but at the moment the new camera appears to be somehow involved. Be it the camera, the act of adding one more camera to AI Tool, or something I haven't yet considered.
 
I'm currently feeling your pain. I had been running AI Tool and the older Windows version of DS for some time without much trouble. Recently I upgraded to the latest Windows version of DS and added a Nano, again with the latest DS. I also added a fourth camera for use with AI. I didn't notice any trouble between the short time when I upgraded DS and when I added the camera, but I can't say for sure if there was an issue. However, after adding the camera I started getting the message that all URLs were in use and processing would stop. After 100 images collected in the queue then I started getting messages about the queue being full. After restarting AI Tool it would process images for a bit and then fail again.

I monkeyed with things quite a bit in an attempt to get it working again. I removed the new version of DS and went back to the old one. I removed AI Tool and tried starting over again, but it appears that you can't start fresh just by deleting the AI Tool program folder. After doing so and starting AI Tool, my cameras and settings were still there. The log said that the config file was messed up and that it was restoring from the registry. So I suppose there's some AI Tool settings stored in the Windows registry, or at least somewhere other than where AI Tool resides.

So I decided to try an older version of AI Tool. I think it was 1.8 something, but I still had the same problem. So I gave up and did a bare metal restore from a backup and restored to a point before I upgraded to the newer version of DS and before I added the new camera, and then everything worked as expected. Well, until I added the fourth camera. After that I started getting the messages about all the URLs being in use. I removed the new camera and everything worked as expected again.

I was running the latest AI Tool and the older version of Windows DS on my BI machine. In an attempt to see if the new version of DS had something to do with it I pointed AI Tool only to the Nano. It seems to be working well now but I haven't had much time for testing. If it proves to be acting normal for a day or two then I'll try adding in the new camera.

The camera isn't anything fancy. Just a cheap Reolink RLC-410 that I put part way down my long driveway to see when someone is coming. There's a tree that blows in the wind but I have it masked out in a BI motion zone so it doesn't generate a lot of images to be analyzed by AI. It doesn't make sense but at the moment the new camera appears to be somehow involved. Be it the camera, the act of adding one more camera to AI Tool, or something I haven't yet considered.

Could it be the ports that the camera uses?
 
This tool have been working very well for me, but very rarely I get some errors and I would like to know what cause them and how they could be avoided:

1. Sometimes the AITool can't access the image file so it tries 10 times and after that it gives up. It's rare that it fails after 10 times but very rarely, after thousands of detections, this error sometimes occurs.
So why is that can't access the file? It seems to be a common error because there is a loop dedicated only to try open the file 10 times.

2. Also very rarely I get a System.Threading.Tasks.TaskCanceledException. I have no idea what is causing it but lately I've been getting it a lot. I don't think it's about having the new deepstack windows version.

System.Threading.Tasks.TaskCanceledException. | A task was canceled (code: -2146233029 )
ERROR: Processing the following image 'C:\BlueIris\aiinput\PrimerPiso.20201226_150956557.jpg' failed. Failure in AI Tool processing the image.

Hopefully someone knows about this error or can comment if they have experienced it on their setup.

Thanks and happy holidays
 
Could it be the ports that the camera uses?

As in a possible port conflict? No. Perhaps I wasn't clear when I said that AI fails when the camera is connected. What I meant is that AI fails when the camera is connected to the AI system, not just to the network. The new camera and AI work fine running beside each other, as long as I don't tell BI to drop the new camera images into the aiinput folder and define the camera in AI Tool then all is well. Currently I'm running zone crossing on the new camera until I can get the AI issue worked out.
 
Since I am new to Docker I have a question, for those running Docker, Do you use Kubernetes and do you deploy docker stacks to kubernetes by default? Should you? what is the benefit? Why would you not do this? Thanks

Also what have messed up here? there is no longer any info showing (deepstack tab) on name and version and the log is full of errors Can you help please.
AI-log.JPGDS tab.JPG
 
Last edited:
I have just installed this tool, following the guide and also following Rob's (The Hookup) YouTube video on the same.
I have everything working, but I find that it takes some time for Blue Iris to trigger. I am using a clone camera as I am recording a substream 24/7 from this camera as well as using it for a trigger.

Has anyone else experienced such delays with Blue Iris initially triggering and saving the image?

As a note: I have Deepstack running on a Ubuntu VM successfully and the AITool is running on the same machine as Blue Iris. The delay seems to be the trigger from Blue Iris, not the processing of the image.
 
So the saving of the image into the folder from BI? Have you changed the time down from the default 1 minute in the jpeg options?
 
So the saving of the image into the folder from BI? Have you changed the time down from the default 1 minute in the jpeg options?
I have the default 1 minute set down to 5 seconds, and the break time on the trigger is 4 seconds.
On the motion sensor settings, I have it set to a fairly sensitive level with a min object size of 300 and min contrast 27.
I also unticked all advanced options.
Edit: Make time is set to 0.5 in Motion Sensor options.