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

Ok, here we go...I'm going to try working thru this again. Can anybody help me get my timings correct enough so I can get a single text that shows what actually created the alert? (Person, cat, dog.)

My camera's hd stream settings:
1603761094788.png
SD stream settings:
1603761128073.png

In BI, on my hd camera, I set the following:
1603761686833.png
1603761660475.png
aitool - cameras - actions - settings - trigger urls:
and port/admin?camera=hd1&trigger&user=user&pw=password
and port/admin?trigger&camera=hd1&user=user&pw=password&flagalert=1&memo=[summary]

With those settings, I walked outside and waved.

aitool history shows:

1603761257483.png

BI has a clip from 6:01:54 to 6:02:15.
I got 3 texts at 6:02:xx; all of them have the same image with the same timestamp: 6:01:55. That's not even listed in the aitools history. ???

Any suggestions as to what settings I can tweak to get the correct image in my text? Like, one of the "relevant" ones listed in aitool?
 
Oh, by the way, in addition to the above, my SD stream is recording 24x7, but not alerting or triggering. At least I have that if something happens while I'm trying to get bi/aitool to work the way I expect them to.
 
Oh, by the way, in addition to the above, my SD stream is recording 24x7, but not alerting or triggering. At least I have that if something happens while I'm trying to get bi/aitool to work the way I expect them to.
Not 100% certain, but it looks like you have your hd camera set to trigger on motion above. Which screenshot shows how your sd cam? That's the one that needs to trigger on motion. AITool will send a trigger back to the HD cam via the link you set up in the camera settings

Sent from my Pixel 3 using Tapatalk
 
Thanks; the instructions on page one of this thread say that for aitool v1.67 on, a single cam should be used, not dual cameras. Those instructions also say to not check the motion detection box on the camera you've setup. But of course if you don't check that box, then no motion gets detected.
 
I just checked the "log everything" box in aitool, then went out front and came back inside (then unchecked the box). Same sort of deal; multiple texts with same image/timestamp.

But here's an excerpt of the log (somewhat sanitized for security). Can somebody tell me if my total, deepstack, file lock, and image queue times are reasonable? They seem really, really high to me...

[20:41:29.057]: OnCreatedAsync> ====================== Adding new image to queue (Count=1): F:\hd1.20201026_204128849.jpg
[20:41:29.680]: DetectObjects> 127.0.0.1:port - (2/6) Posted in 2179ms, Received a 124 byte response.
[20:41:29.689]: DeepStack> Server.exe> [GIN] 2020/10/26 - 20:41:29 | 200 | 2.088998s | 127.0.0.1 | POST /v1/vision/detection
[20:41:29.695]: DetectObjects> 127.0.0.1:port - (3/6) Processing results...
[20:41:29.697]: DetectObjects> 127.0.0.1:port - Detected objects: Person (99.65%),
[20:41:29.699]: DetectObjects> 127.0.0.1:port - (4/6) Checking if detected object is relevant and within confidence limits:
[20:41:29.702]: DetectObjects> Person (99.65%): Upper: 0 Lower: 100
[20:41:29.723]: CreateDynamicMask> * Starting new object mask processing *
[20:41:29.726]: CreateDynamicMask> Current object detected: key=933816, name=Person, xmin=984, ymin=240, xmax=1547, ymax=1477, counter=0, camera=hd1, create date: 10/26/2020 8:41:29 PM on camera hd1
[20:41:29.729]: CreateDynamicMask> + New object found: key=933816, name=Person, xmin=984, ymin=240, xmax=1547, ymax=1477, counter=0, camera=hd1, create date: 10/26/2020 8:41:29 PM. Adding to last_positions_history for camera: hd1
[20:41:29.746]: Outsidemask> Checking if the object is in a masked area...
[20:41:29.752]: Outsidemask> 9 of 9 detection points are outside of masked areas.
[20:41:29.754]: Outsidemask> ->The object is OUTSIDE of masked area(s).
[20:41:29.757]: DetectObjects> 127.0.0.1:port - Person (99.65%) confirmed.
[20:41:29.760]: DetectObjects> 127.0.0.1:port - The summary:Person (99.65%)
[20:41:29.762]: DetectObjects> 127.0.0.1:port - (5/6) Performing alert actions:
[20:41:29.851]: MergeImageAnnotations> Merged 1 detections in 96ms into image C:\Users\me\AppData\Local\Temp\hd1.20201026_204124797.jpg
[20:41:29.863]: CallTriggerURLs> -> trigger URL called: http://ip:port/admin?camera=hd1&trigger&user=user&pw=password, response: 'signal=green profile=1 lock=0 clip=50048492 camera=hd1 '
[20:41:29.884]: CallTriggerURLs> -> trigger URL called: http://ip:port/admin?trigger&camera=hd1&user=user&pw=password&flagalert=1&memo=Person%20(99.65%25), response: 'signal=green profile=1 lock=0 clip=50048492 camera=hd1 '
[20:41:29.886]: Trigger> Copying image to network folder...
[20:41:29.889]: CopyImage> File copying from C:\Users\me\AppData\Local\Temp\hd1.20201026_204124797.jpg to G:\AlertImages\hd1.20201026_204124797.jpg
[20:41:29.898]: Trigger> -> Image copied to network folder.
[20:41:29.905]: Trigger> hd1 last triggered at 10/26/2020 8:41:29 PM.
[20:41:29.917]: DetectObjects> 127.0.0.1:port - (6/6) SUCCESS.
[20:41:29.920]: DetectObjects> 127.0.0.1:port - Adding detection to history list.
[20:41:29.922]: DetectObjects> 127.0.0.1:port - Total Time: 4996ms (Count=10, Min=2122ms, Max=47501ms, Avg=7703ms)
[20:41:29.927]: DetectObjects> 127.0.0.1:port -DeepStack (URL) Time: 2179ms (Count=10, Min=1760ms, Max=43420ms, Avg=6252ms)
[20:41:29.935]: DetectObjects> 127.0.0.1:port - File lock Time: 0ms (Count=1, Min=1ms, Max=1ms, Avg=1ms)
[20:41:29.938]: DetectObjects> 127.0.0.1:port - Image Queue Time: 2536ms (Count=10, Min=263ms, Max=4042ms, Avg=1322ms)
[20:41:29.943]: DetectObjects> 127.0.0.1:port - Image Queue Depth: 1 (Count=12, Min=1, Max=1, Avg=1)
[20:41:30.280]: ImageQueueLoop> Adding task for file 'hd1.20201026_204126827.jpg' (Image QueueTime='0.1' mins, URL Queue wait='2563ms', URLOrder=1 of 1, URLOriginalOrder=1) on URL 'http://127.0.0.1:port/v1/vision/detection'
[20:41:30.284]: DetectObjects> 127.0.0.1:port - Starting analysis of F:\hd1.20201026_204126827.jpg...
[20:41:30.324]: DetectObjects> 127.0.0.1:port - (1/6) Uploading a 1191802 byte image to DeepQuestAI Server at http://127.0.0.1:port/v1/vision/detection
[20:41:30.583]: WaitForNextURL> ---- All URL's are in use or disabled, waiting...
 
Any suggestions as to what settings I can tweak to get the correct image in my text? Like, one of the "relevant" ones listed in aitool?

It is recommended to set your i-interval to the same as your fps in your camera settings.

So set it to 15 instead of 30 in your case.
Or set your fps to 30.
 
  • Like
Reactions: whoami ™
Thanks; the instructions on page one of this thread say that for aitool v1.67 on, a single cam should be used, not dual cameras. Those instructions also say to not check the motion detection box on the camera you've setup. But of course if you don't check that box, then no motion gets detected.

I might be using a different method than you, but I'll mention this as barnyard has...
I use a 1 physical camera, but I also have this copied as a BI camera clone. So there are 2 streams of the same cam basically, that you can setup with different settings. In my setup, only the clone has the motion detection enabled (in my case it uses no extra cpu, but ymmv). so the clone is triggered by motion, and it captures an image for the AI tool input folder, deepstack then confirms an object is there, then AI tool triggers the original BI camera to save an alert image. That way i only save images if there has been a positive ID first, and I have very clear control over my alert settings vs my motion settings (there is no crossover due to using the same cam, even though it is the same physical cam). Maybe worth a try?
 
Any suggestions as to what settings I can tweak to get the correct image in my text? Like, one of the "relevant" ones listed in aitool?

It sounds like you have motion turned on for the Alerts tab. I uncheck everything except Extern. This way when the camera detects motion it does not alert you. Only when the AI tool sends the external alert command.

blueirisalert.PNG
 
I'm still receiving all these notification

[26.10.2020, 15:07:08]: ERROR: Can't write to cameras/history.csv!
[26.10.2020, 15:07:08]: ERROR: Can't write to cameras/history.csv!
[26.10.2020, 15:12:08]: ERROR: Can't write to cameras/history.csv!
[26.10.2020, 15:12:08]: ERROR: Can't write to cameras/history.csv!
[26.10.2020, 15:12:08]: ERROR: Can't write to cameras/history.csv!
[26.10.2020, 15:12:08]: ERROR: Can't write to cameras/history.csv!
[26.10.2020, 15:12:08]: ERROR: Can't write to cameras/history.csv!

Someone solved this problem ?

As I read somewhere in the topic, it seem connected to when the pictures in the AiInput folder are deleted. Also if it doesn't make much sense as they are different folders.

For future reference. The problem was caused by having AITool open as service when the console was open, it counts as having a second instance running and screw the access to files.

Now everything is working fine. I'll try the fork project, I just read about in some topic above when I'll have time.
 
For future reference. The problem was caused by having AITool open as service when the console was open, it counts as having a second instance running and screw the access to files.

Now everything is working fine. I'll try the fork project, I just read about in some topic above when I'll have time.


I created a small BAT file that makes sure the service is killed before I open a new console. It also kills any running consoles before starting a new one.

Code:
net stop "AI tool"
taskkill /IM  "AITool.exe"
start /b /d H:\BlueIris\AI.Tool H:\BlueIris\AI.Tool\aitool.exe
 
Last edited:
It is recommended to set your i-interval to the same as your fps in your camera settings.

So set it to 15 instead of 30 in your case.
Or set your fps to 30.

Huh...maybe that's why my camera fps (in bi) was set to 30! I just set it to 15 so see if I could see a smoother live video feed. Thanks; I'll change fps back to 30.

I use a 1 physical camera, but I also have this copied as a BI camera clone.

This is how I had it setup till a few days ago; I had all the same issues. Only thing I didn't have was the extra hd recordings (now the hd stream records all motion, but only alerts me on stuff that aitools thinks I should be alerted on). But both ways, images in text are wrong 99% of the time.

It sounds like you have motion turned on for the Alerts tab.

Yeah; I didn't quite understand that, thanks for the tip. I'll uncheck that when I get home tonight and try again.
 
Are they both using the same port where you'd have a conflict? What I mean is Blue Iris is assigned a port and you need to make sure that Deepstack is running on a different port as well.

One way to test, if Deepstack is turned off are you able to get a Blue Iris response?
 
  • Like
Reactions: snuffaluhfaguss
Well I just spent the last 3 hours re-doing everything, uninstalled everything and started from new.

And guess it works now.

I wish I could say I have an answer as why it was giving me that issue, but I have no idea.

Thank you for the assistance either way jooced! :)
 
  • Like
Reactions: Jooced
I think it has to do with this one section. I got a little lost here. I was not sure if we were supposed to put both of the urls in or not.
When I tried them in a webpage to get an alert nothing happened.Trigger URL.PNG
 
Is this an issue?
When I restart everything I get this- Redis-server.exe> [10212] 27 Oct 16:16:00 # Warning: no config file specified, using the default config. In order to specify a config file use 'redis-server /path/to/redis.conf'
Then I get this line Error: 5 python.exe processes did not fully start in 10025ms
and then I will get about 100+ of these errors- Python.exe> ERROR: 2020-10-27 15:16:32.7271106 [W:onnxruntime:InferenceSession, session_state_initializer.cc:500 onnxruntime::SaveInputOutputNamesToNodeMapping] Graph input with name 318 is not associated with a node.

It all appears to be fine and it is sending alerts, is this a real issue or just part of start up? THX.
 
To me it looks like Deepstack didn't close correctly and it starting multiple instances.

Make sure to close down Server.exe, Redis-server.exe and Python.exe (I think). Then you can start up without errors.