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

Nick3399

n3wb
Joined
Jun 24, 2018
Messages
17
Reaction score
1
Location
Nc
Yes sir. If you setup AI tool and Deep Stack on the first page, the AI tool will send the image to deepstack, verify there is a person in it, then send an external trigger to Blue Iris that the alert was valid and to record/send alert.
Oh okay perfect! I did all of that, I just wasn’t sure if I was missing something to connect AI tool to Blue Iris - will try and test out tonight!
Also for the masking question, I have reviewed all documentation but I’m looking for specifically if I usually have cars parked in driveway, I mask them out, but I only want to mask cars in the area, so if a person walks in mask it still picks up... is that not possible?
 

crowax

n3wb
Joined
May 26, 2020
Messages
4
Reaction score
0
Oh okay perfect! I did all of that, I just wasn’t sure if I was missing something to connect AI tool to Blue Iris - will try and test out tonight!
Also for the masking question, I have reviewed all documentation but I’m looking for specifically if I usually have cars parked in driveway, I mask them out, but I only want to mask cars in the area, so if a person walks in mask it still picks up... is that not possible?
As far as I know, that is not possible. You could set up two separate cameras pointing to the same cameras. So Driveway-Car and Driveway-Person. Then add both in AI tools. For the Car one, add the mask and check to only detect cars. Then for the Person one, do not add a mask but uncheck alerting for cars. You can then Hide one of the cameras in Blue Iris so you dont have to see or deal with it. In the AI Tools, have both cameras send the trigger alert to the one camera you want. So both Driveway-Car and Driveway-Person will send a trigger to Driveway-Person. I've never tried this but it seems like it would work. You also might be able to use one camera and just create two AI tools cameras that reference the same image created. Not sure what would happen when both try to process one file.
 

Nick3399

n3wb
Joined
Jun 24, 2018
Messages
17
Reaction score
1
Location
Nc
As far as I know, that is not possible. You could set up two separate cameras pointing to the same cameras. So Driveway-Car and Driveway-Person. Then add both in AI tools. For the Car one, add the mask and check to only detect cars. Then for the Person one, do not add a mask but uncheck alerting for cars. You can then Hide one of the cameras in Blue Iris so you dont have to see or deal with it. In the AI Tools, have both cameras send the trigger alert to the one camera you want. So both Driveway-Car and Driveway-Person will send a trigger to Driveway-Person. I've never tried this but it seems like it would work. You also might be able to use one camera and just create two AI tools cameras that reference the same image created. Not sure what would happen when both try to process one file.

Okay, thanks. And sorry one last question :( How do I add the summary/description & the confidence into the blue iris push notification? I see that AI Tool updates the stream with the identified items and confidence, but when I tried adding &summary into the 'text' section within BI alerts, it didn't work properly... Ideally, I am only looking to add 'Person + Confidence' to the push notification when a person is detected, and not all of the other things it finds (ex. couch, bed)
 
Last edited:

Tinbum

Pulling my weight
Joined
Sep 5, 2017
Messages
448
Reaction score
126
Location
UK
You also might be able to use one camera and just create two AI tools cameras that reference the same image created. Not sure what would happen when both try to process one file.
It will only process in one camera- but Chris may change that if you ask and he can!
 
Joined
Nov 4, 2020
Messages
1
Reaction score
0
Location
NY
Has anyone tried "faking" out BI and smartsentry.ai by redirecting smarsentry.ai to 127.0.0.1 using the Windows 'hosts' file? Then on the local server, run a webserver that 1) returns the necessary 'license' response and 2) returns a correctly formatted response using the image(s) that BI provides? This would allow for seamless integration with BI, rather than relying on saving a snapshot to a separate folder and posting back a trigger event to BI such as AITool does...
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,061
Reaction score
956
If you have a location to change the start command for the docker you can add the environment variables on the start line.
For example: docker run -e VISION-DETECTION =True -v localstorage:/datastore -p 80:5000 deepquestai/deepstack:latest

But I think the easy answer is to just add the variables through the UI.


I found a few links that may help.

If you look at the this link Setup HomeAssistant on QNAP Container using Docker – Poyu do you see an option on the left side for environment variables ? see below image from the link listed.

View attachment 74149


Last I found this link that talks about working within the container config files.

Hope this helps some.
Entering the Environmental Variable as shown above wouldn't work because hyphens are not allowed. I'm going to read through the second link you provided. I really appreciate your help!
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,061
Reaction score
956
If your running Deepstack on a different machine in Docker, does that machine need access to the alert images on the BI machine where AI Tools is installed?
 

yusufptl

n3wb
Joined
Nov 5, 2020
Messages
11
Reaction score
1
Location
South Africa
im trying to set this up but keep getting an error


[05.11.2020, 10:28:20]: ERROR: Processing the following image 'E:\Snapshots\Cam4.20201105_102819598.jpg' failed. Failure in AI Tool processing the image.
[05.11.2020, 10:30:26.002]: Cleaning cameras/history.csv if neccessary...
[05.11.2020, 10:30:28.703]: Loading time line from cameras/history.csv ...
[05.11.2020, 10:30:28.708]: Loading confidence-frequency chart from cameras/history.csv ...
[05.11.2020, 10:30:36.518]: Loading time line from cameras/history.csv ...
[05.11.2020, 10:30:36.522]: Loading confidence-frequency chart from cameras/history.csv ...
[05.11.2020, 10:31:02.304]: Loading time line from cameras/history.csv ...
[05.11.2020, 10:31:02.309]: Loading confidence-frequency chart from cameras/history.csv ...
[05.11.2020, 10:31:53]: ERROR: Processing the following image 'E:\Snapshots\Cam4.20201105_103153347.jpg' failed. Failure in AI Tool processing the image.
[05.11.2020, 10:31:53.373]:
[05.11.2020, 10:31:53.377]: Starting analysis of E:\Snapshots\Cam4.20201105_103153347.jpg
[05.11.2020, 10:31:53.392]: (1/6) Uploading image to DeepQuestAI Server
[05.11.2020, 10:31:53.451]: (2/6) Waiting for results
[05.11.2020, 10:31:53.548]: (3/6) Processing results:
[05.11.2020, 10:31:53.553]: System.NullReferenceException | Object reference not set to an instance of an object. (code: -2147467261 )
[05.11.2020, 10:31:53.556]: ERROR: Processing the following image 'E:\Snapshots\Cam4.20201105_103153347.jpg' failed. Failure in AI Tool processing the image.

deepstack is running on windows docker using this command

docker run -e VISION-SCENE=True -v localstorage:/datastore:rw -p 80:5000 deepquestai/deepstack
 

barnyard

n3wb
Joined
Aug 9, 2020
Messages
24
Reaction score
5
Location
United States
im trying to set this up but keep getting an error





deepstack is running on windows docker using this command

docker run -e VISION-SCENE=True -v localstorage:/datastore:rw -p 80:5000 deepquestai/deepstack
Should be:
VISION-DETECTION =True

Sent from my Pixel 3 using Tapatalk
 

yusufptl

n3wb
Joined
Nov 5, 2020
Messages
11
Reaction score
1
Location
South Africa
Should be:
VISION-DETECTION =True

Sent from my Pixel 3 using Tapatalk
I changed the implementation to the windows deepstack executable and it's working now.

Picks up my chickens as 66% human and me crawling as 51% human

Sent from my SM-N960F using Tapatalk
 

kosh42efg

n3wb
Joined
Aug 14, 2020
Messages
29
Reaction score
13
@105437 - From the error, the problem still does not look like it is on the AITOOL end. I dont think you have VISION-DETECTION=True set correct as talked about above. I wouldnt know how to do that for QNAP.

Same error here, and I'm pretty sure it is because he is using VISION-SCENE=True not VISION-DETECTION=True:
Damn it, that's my old post. I must try again in that case, as I never got it working...
 

yusufptl

n3wb
Joined
Nov 5, 2020
Messages
11
Reaction score
1
Location
South Africa
@105437 - From the error, the problem still does not look like it is on the AITOOL end. I dont think you have VISION-DETECTION=True set correct as talked about above. I wouldnt know how to do that for QNAP.

Same error here, and I'm pretty sure it is because he is using VISION-SCENE=True not VISION-DETECTION=True:

Also I saw the Deepstack tab > STOP being used in the log before - to be clear, that is only for the Windows version running on the same machine. Nothing to do with the QNAP version. And you wouldn't see those PYTHON errors from qnap either.
We get viscio-scene from the deepstack tutorial of docker installation.

Copy and paste

Sent from my SM-N960F using Tapatalk
 

Senor Pibb

Getting the hang of it
Joined
May 22, 2020
Messages
77
Reaction score
36
Location
Greer, SC
We get viscio-scene from the deepstack tutorial of docker installation.

Copy and paste

Sent from my SM-N960F using Tapatalk
Yep, that feature looks at the entire image and tries to decide what the scene is. (conference room), detection looks for an object in an image to determine if its there. Or at least that is how I read it...
 
Last edited:

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
147
Reaction score
23
Location
TX
Bug, annoyance or operator error?

Using the newest AI tool V2. Since it does not use the camera folder, there are no masks being pulled, I have not drawn any custom masks but am getting this error - "The resolution of the mask 'C:\Users\user\Downloads\AI.Tool.1.67\Release\_Settings\Backyardsd.bmp' does not equal the resolution of the processed image. Skipping privacy mask feature. Image: 768x432, Mask: 1920x1080" Not sure if this is related or if I am even using it correctly but I do have Dynamic masking enabled and under settings I have listed dining table, chair, potted plant, cup, bowl, bench in the "objects" block. I assume items listed there are ignored by the system. TIA.
 

Senor Pibb

Getting the hang of it
Joined
May 22, 2020
Messages
77
Reaction score
36
Location
Greer, SC
Bug, annoyance or operator error?

Using the newest AI tool V2. Since it does not use the camera folder, there are no masks being pulled, I have not drawn any custom masks but am getting this error - "The resolution of the mask 'C:\Users\user\Downloads\AI.Tool.1.67\Release\_Settings\Backyardsd.bmp' does not equal the resolution of the processed image. Skipping privacy mask feature. Image: 768x432, Mask: 1920x1080" Not sure if this is related or if I am even using it correctly but I do have Dynamic masking enabled and under settings I have listed dining table, chair, potted plant, cup, bowl, bench in the "objects" block. I assume items listed there are ignored by the system. TIA.
Not the camera folder, but it does save it in the _settings. If you copy your bmp from camera to _settings does fix the issue?
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
147
Reaction score
23
Location
TX
Not the camera folder, but it does save it in the _settings. If you copy your bmp from camera to _settings does fix the issue?
That's it I don't have any mask bmp or otherwise so not sure what it is seeing? I will check and see what is in the _settings
 

balucanb

Getting the hang of it
Joined
Sep 19, 2020
Messages
147
Reaction score
23
Location
TX
Not the camera folder, but it does save it in the _settings. If you copy your bmp from camera to _settings does fix the issue?
BINGO! That was it. I must have been playing around with thar camera in a previous version, there was indeed a BMP in there. Thanks for help!
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,061
Reaction score
956
Spending way too many hours trying to get AI Tool to work with my Docker instance of Deepstack running on my QNAP NAS. Keep getting this error when it tries to analyze alert images.

2020-11-05 16:28:40.006515|Info|AITOOLS.EXE|Shell_Load|None|None|None| APP START complete. Initialized in 1.9 seconds (1890ms)|75|2|yellow|1
2020-11-05 16:28:40.073473|Debug|AITOOLS.EXE|CleanHistoryList|None|None|None| No missing files to clean from database?|76|2||6
2020-11-05 16:28:40.073473|Debug|AITOOLS.EXE|CleanHistoryList|None|None|None| ...Cleaned 0 items in 175ms|77|2||6
2020-11-05 16:28:40.206392|Debug|AITOOLS.EXE|HistoryStartStop|None|None|None| History update timer started.|79|0||1
2020-11-05 16:29:15.628611|Debug|AITOOLS.EXE|OnCreated|None|None|None| |80|1||8
2020-11-05 16:29:15.628611|Debug|AITOOLS.EXE|OnCreated|None|Front_AI|Front_Cam.20201105_162915477.jpg| ====================== Adding new image to queue (Count=1): S:\BI_AI\Front_Cam.20201105_162915477.jpg|81|1||8
2020-11-05 16:29:15.996383|Debug|AITOOLS.EXE|WaitForNextURL|None|Front_AI|None| Updating/Resetting AI URL list...|82|1||6
2020-11-05 16:29:16.021369|Debug|AITOOLS.EXE|WaitForNextURL|None|Front_AI|None| ---- #1: Added new URL: 2020-11-05 16:29:16.021369|Debug|AITOOLS.EXE|WaitForNextURL|None|Front_AI|None| ...Found 1 AI URL's in settings.|84|0||6
2020-11-05 16:29:16.021369|Debug|AITOOLS.EXE|ImageQueueLoop|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Adding task for file 'Front_Cam.20201105_162915477.jpg' (Image QueueTime='0.0' mins, URL Queue wait='30ms', URLOrder=1 of 1, URLOriginalOrder=1) on URL '2020-11-05 16:29:16.022368|Debug|AITOOLS.EXE|ImageQueueLoop|192.168.1.155:5000|Front_AI|None| Done adding 1 total threads, ErrCnt=0, ImageProcessQueue.Count=0|86|0||6
2020-11-05 16:29:16.047353|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Starting analysis of S:\BI_AI\Front_Cam.20201105_162915477.jpg...|87|1||7
2020-11-05 16:29:16.100319|Debug|AITOOLS.EXE|IsValidImage|192.168.1.155:5000|Front_AI|None| Image file is valid: Front_Cam.20201105_162915477.jpg|88|2||7
2020-11-05 16:29:16.103317|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| (1/6) Uploading a 2562149 byte image to DeepQuestAI Server at 2020-11-05 16:29:16.160282|Error|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Got http status code 'Forbidden' (403) in 57ms: Forbidden|90|1||7
2020-11-05 16:29:16.164279|Error|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Empty string returned from HTTP post.|91|1||7
2020-11-05 16:29:16.166279|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Total Time: 536ms (Count=1, Min=536ms, Max=536ms, Avg=536ms)|92|1||7
2020-11-05 16:29:16.166279|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| DeepStack (URL) Time: 57ms (Count=1, Min=57ms, Max=57ms, Avg=57ms)|93|1||7
2020-11-05 16:29:16.166279|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| File lock Time: 2ms (Count=1, Min=2ms, Max=2ms, Avg=2ms)|94|1||7
2020-11-05 16:29:16.166279|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Image Queue Time: 417ms (Count=1, Min=417ms, Max=417ms, Avg=417ms)|95|1||7
2020-11-05 16:29:16.166279|Debug|AITOOLS.EXE|DetectObjects|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| Image Queue Depth: 1 (Count=1, Min=1, Max=1, Avg=1)|96|1||7
2020-11-05 16:29:16.166279|Info|AITOOLS.EXE|ImageQueueLoop|192.168.1.155:5000|Front_AI|None|...Problem with AI URL: '' (URL ErrCount=2, max allowed of 5)|97|0||7
2020-11-05 16:29:16.166279|Info|AITOOLS.EXE|ImageQueueLoop|192.168.1.155:5000|Front_AI|Front_Cam.20201105_162915477.jpg| ...Putting image back in queue due to URL '' problem (QueueTime=0.0, Image ErrCount=0, Image RetryCount=1, URL ErrCount=2): 'S:\BI_AI\Front_Cam.20201105_162915477.jpg', ImageProcessQueue.Count=0|98|1||7
2020-11-05 16:29:16.489040|Info|AITOOLS.EXE|WaitForNextURL|192.168.1.155:5000|Front_AI|None|---- Waiting 30 seconds before retrying bad URL. (ErrCount=2 of 5, Setting 'MinSecondsBetweenFailedURLRetry'=30): 2020-11-05 16:29:16.489040|Info|AITOOLS.EXE|WaitForNextURL|192.168.1.155:5000|Front_AI|None|---- All URL's are in use or disabled, waiting...|100|0||11
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,061
Reaction score
956
I ssh'd to the Deepstack Docker container and tried to run the following command. I know very little about Docker, just trying to learn as I go.

root@deepstack:/app/server# docker run -e VISION-DETECTION=True -v localstorage:/datastore:rw -p 80:5000 deepquestai/deepstack
bash: docker: command not found
root@deepstack:/app/server#
 
Top