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

Has anyone had issues with the alert image not being sent to the folder for AI Tool to analyze? Last night my father in law stopped but I didn't receive an alert from AI Tool. I began digging into BI to see what happened. I have my cameras and cloned cameras set up per this threads recommendations. From what I can tell, the cloned camera was triggered and recorded the event, but no jpeg images were sent to the AI folder that DeepStack watches for this event. I realize that this is likely a BI issue as the images never made it for DeepStack/AI Tool to analyze. I'm just wondering if others have ran into this issue. I know that one way to mitigate this is to have jpeg images sent to the folder all of the time instead of when triggered, but I am just confused since BI shows the event and the camera was indeed triggered. I also set up another cloned camera to have Sentry send email alerts when a person is detected (for a side by side comparison of Sentry vs AI Tool before making the switch to AI Tool) and I received an email of the event. I also reviewed the event logs on the BI machine during the time of the event and don't see anything that would indicate a resource or OS/BI issue.
 
I'm having the same symptoms where ai tool fails sending images to the deepquest ai server. The only difference is I'm using win 10 home.
AI Tool 1.64​
Deepstack AI: 1.0.0.0, date modified May 4, 2019​
Blue Iris: 5.0.6.11 x64​
OS: Windows 10 Home version 1909, build 18363.535​

I'm running the last version of BI and the latest update of Windows 10 Pro. I installed AI Tool and the DeepStack server and reconfigured 4 of my 10 cameras to use it. Everything was running great for a number of days, when after a reboot, the AI Tool was unable to connect with the following error:
[09.12.2019, 11:30:48]: Starting analysis of K:\BlueIris\aiinput/aicam1.20191209_112416887.jpg
[09.12.2019, 11:30:48]: (1/6) uploading image to DeepQuestAI Server ...
[09.12.2019, 11:31:16]: ERROR: Processing the image K:\BlueIris\aiinput/aicam1.20191209_111501490.jpg failed. Can't reach DeepQuestAI Server at 127.0.0.1:83.
I then wrote a Python app using the published examples of the DeepStack API running on a number of clients. The "requests.post" hangs indefinitely until the server process is stopped. Monitoring server.exe TCP/IP connections it appears the images are sent to the server process and then hangs. Nothings is reported in the DeepStack monitor windows. Nevertheless, I can connect via a web browser to the key authorization page.

When either AItool connects or my python app, some other TCP/IP apps on that machine have network access. It appears the TCP/IP stack is being corrupted by the DeepStack server software, since the Windows machine absent DeepStack operates flawlessly. The AI implementation is very good, unfortunately I'm stuck without source to attempt to further debug the issue. Would welcome any comments especially if anyone has seen this issue before.
 
Guys I think I had the same issue (see the first 2 pages of this thread). I could never sort it out. Ended up running Deepstack on a separate virtual server (with docker) and never had any issues since then.
As a last resort (if anything else doesn't fix your issues) and you have no access to virtual servers to run Deepstack separately, perhaps install docker on the BI computer and testto see if it works.
 
I am now getting errors in AI tool. I tried restarting the service as well as renaming the history.csv to history.csv.old I've since renamed the original, but continue to get errors in the logs. Has anyone else ran across this problem?

.12.2019, 14:37:46]: ERROR: Can't write to cameras/history.csv!
[17.12.2019, 14:37:46]: ERROR: Can't write to cameras/history.csv!
[17.12.2019, 14:37:46]: ERROR: Can't write to cameras/history.csv!
[17.12.2019, 14:37:46]: ERROR: Can't write to cameras/history.csv!
[17.12.2019, 15:04:45]: ERROR: Can't clean the cameras/history.csv!
[17.12.2019, 15:05:32]: ERROR: Can't clean the cameras/history.csv!
[17.12.2019, 15:12:22]: ERROR: Can't clean the cameras/history.csv!
[17.12.2019, 15:12:37]: ERROR: Can't clean the cameras/history.csv!
 
  • Like
Reactions: DigitalD
Guys I think I had the same issue (see the first 2 pages of this thread). I could never sort it out. Ended up running Deepstack on a separate virtual server (with docker) and never had any issues since then.
As a last resort (if anything else doesn't fix your issues) and you have no access to virtual servers to run Deepstack separately, perhaps install docker on the BI computer and testto see if it works.
Thanks for your advice!

Running deepstack in Docker resolved the image upload error after switching to the docker image with the "noavx" tag.
I also had to switch to a lower resolution video stream since Deepstack doesn't support images larger than 2k by 2k.
 
Last edited:
Hi,
thanks for the great tool, and instructions. I've setup so far 4 cameras with 4 clones similar to post 219 on page 11 in this forum.
only thing I've noticed that I haven't been able to resolve is after the AI Tool sends a trigger via url to the original camera with motion detection disabled
the alert clips are generated with good start time of the event but not event end time. my original camera Record tab is set to "Continuous".
Playing the clip a few hours later the clip plays from the correct start time, but the video plays until it reaches live recording always.
this url in AI Tool sets the trigger start time, but not trigger end time.


this might be the limitation with external triggering i suppose.
meanwhile I'll research BI url that can also run trigger break time, and run it from inside the original camera
alert web request action on itself, hopefully alert actions execute in sequential order.
 
Hi,
thanks for the great tool, and instructions. I've setup so far 4 cameras with 4 clones similar to post 219 on page 11 in this forum.
only thing I've noticed that I haven't been able to resolve is after the AI Tool sends a trigger via url to the original camera with motion detection disabled
the alert clips are generated with good start time of the event but not event end time. my original camera Record tab is set to "Continuous".
Playing the clip a few hours later the clip plays from the correct start time, but the video plays until it reaches live recording always.
this url in AI Tool sets the trigger start time, but not trigger end time.


this might be the limitation with external triggering i suppose.
meanwhile I'll research BI url that can also run trigger break time, and run it from inside the original camera
alert web request action on itself, hopefully alert actions execute in sequential order.

Is your break time set in the original cameras trigger tab?
 
I'm trying to get it work, using deepstack on docker on different machine with ai version 1.64.
I'm receiving the following error:

Code:
[23.12.2019, 19:19:01]:
[23.12.2019, 19:19:01]: Starting analysis of F:\snapshot/CancelloSotto.20191223_191901797.jpg
[23.12.2019, 19:19:01]: (1/6) uploading image to DeepQuestAI Server ...
[23.12.2019, 19:19:01]: (2/6) Waiting for results ...
[23.12.2019, 19:19:01]: (3a/6) Deserializing results ...
[23.12.2019, 19:19:01]: (3b/6) Processing results:
[23.12.2019, 19:19:01]: ERROR: Processing the image F:\snapshot/CancelloSotto.20191223_191901797.jpg failed. Failure in AI Tool processing the image.
 
Is your break time set in the original cameras trigger tab?

Yes 10sec, i'm starting to think I have a buggy version of Blue Iris. my version 5.0.7.2 x64.
I just bought this, so I haven't found a release that is working great yet.
even trying to trigger by Global DIO Input bits is very inconsistent behavior on my release
using the url
http://localhost:##/admin?input=#&trigger

For temporary workaround, I've created 2 clones for 1 physical camera,
clone 1 - aiCamera for generating jpeg snapshots at 5 sec interval.
clone 2 - this is triggered by AI Tools, this one is configured to record video only when triggered and break time ##sec
Original - this one is configured to record continuously only (never triggered).

the cpu usage does go up, not sure if its the continuous recording or 2 clones or too many continuous camera recordings on 1 HDD.
I'll have to experiment splitting continuous recordings from multiple cameras to 2 HDD once I get a 2nd HDD setup.
 
update v1.65
  • substantially enhanced stability and speed of image analysis
  • send alert images to multiple Telegram accounts
  • enhanced history list loading speed
  • fixed code that detects image loading errors
  • upload image to Telegram if an error occurs
  • added button to open log file from settings page
  • Added milliseconds to log time when 'log everything' is checked
  • futher enhancements of the log
  • several bugfixes
 
Last edited:
With new update i've the same error, but more detailed

Code:
[25.12.2019, 00:31:08.933]:
[25.12.2019, 00:31:08.934]: Starting analysis of F:\snapshot/CancelloSotto.20191225_003108864.jpg
[25.12.2019, 00:31:09.044]: (1/6) Uploading image to DeepQuestAI Server
[25.12.2019, 00:31:09.414]: (2/6) Waiting for results
[25.12.2019, 00:31:09.845]: (3/6) Processing results:
[25.12.2019, 00:31:09.847]: System.NullReferenceException | Object reference not set to an instance of an object. (code: -2147467261 )
[25.12.2019, 00:31:09.847]: ERROR: Processing the following image 'F:\snapshot/CancelloSotto.20191225_003108864.jpg' failed. Failure in AI Tool processing the image.

I've tried with a simple python script to check connections:

Code:
Code:
import requests

image_data = open("CancelloSotto.20191224_222459394.jpg","rb").read()

response = requests.post("http://192.168.1.236:5000/v1/vision/scene",files={"image":image_data}).json()
print("Label:",response["label"])
print(response)

response:
Code:
Label: catacomb
{'success': True, 'label': 'catacomb', 'confidence': 0.6953874}
 
With new update i've the same error, but more detailed

Code:
[25.12.2019, 00:31:08.933]:
[25.12.2019, 00:31:08.934]: Starting analysis of F:\snapshot/CancelloSotto.20191225_003108864.jpg
[25.12.2019, 00:31:09.044]: (1/6) Uploading image to DeepQuestAI Server
[25.12.2019, 00:31:09.414]: (2/6) Waiting for results
[25.12.2019, 00:31:09.845]: (3/6) Processing results:
[25.12.2019, 00:31:09.847]: System.NullReferenceException | Object reference not set to an instance of an object. (code: -2147467261 )
[25.12.2019, 00:31:09.847]: ERROR: Processing the following image 'F:\snapshot/CancelloSotto.20191225_003108864.jpg' failed. Failure in AI Tool processing the image.

I've tried with a simple python script to check connections:

Code:
Code:
import requests

image_data = open("CancelloSotto.20191224_222459394.jpg","rb").read()

response = requests.post("http://192.168.1.236:5000/v1/vision/scene",files={"image":image_data}).json()
print("Label:",response["label"])
print(response)

response:
Code:
Label: catacomb
{'success': True, 'label': 'catacomb', 'confidence': 0.6953874}


What does return for this image? Please write me a PM to resolve this issue.
 
Last edited:
Sorry, my fault. In docker I have not enabled VISION-DETECTION.
I've found that by sending the image to , at first response is:
{u'success': False, u'error': u'Detection endpoint not activated'}
After enabling VISION-DETECTION response is:
Code:
{u'predictions': [{u'confidence': 0.9702598, u'y_min': 204, u'y_max': 327, u'label': u'chair', u'x_max': 157, u'x_min': 0}, {u'confidence': 0.8796837, u'y_min': 203, u'y_max': 522, u'label': u'chair', u'x_max': 953, u'x_min': 632}, {u'confidence': 0.87255776, u'y_min': 524, u'y_max': 629, u'label': u'chair', u'x_max': 943, u'x_min': 500}, {u'confidence': 0.8133027, u'y_min': 223, u'y_max': 294, u'label': u'chair', u'x_max': 601, u'x_min': 495}, {u'confidence': 0.7560369, u'y_min': 221, u'y_max': 308, u'label': u'chair', u'x_max': 302, u'x_min': 230}, {u'confidence': 0.6821674, u'y_min': 215, u'y_max': 395, u'label': u'chair', u'x_max': 832, u'x_min': 678}, {u'confidence': 0.6354728, u'y_min': 313, u'y_max': 619, u'label': u'chair', u'x_max': 971, u'x_min': 592}, {u'confidence': 0.81980866, u'y_min': 299, u'y_max': 610, u'label': u'dining table', u'x_max': 677, u'x_min': 0}, {u'confidence': 0.99507195, u'y_min': 204, u'y_max': 396, u'label': u'laptop', u'x_max': 605, u'x_min': 325}], u'success': True}

and AI Tools Works Correctly, maybe logging the response on "success:False" can be an enhancements

Thanks
 
What would be the advantage?
I'd like to manage the events and the notification in an alternative way. The idea is to obtain that results:
  • Notification can be turned on and off by schedule or mqtt commands
  • Notification can contain camera name, object detected and confidence
  • Snapshot with true alerts can be stored, and false deleted
The idea is to implemet in my domotic system so i can turn on/off notification (via mqtt) as an alarm system
 
Ok, I understand you.
This is alot of work to implement and it's not really related to the actual purpose of this software, so I'd recommend to solve this special task using a small python script.
 
I was hoping for the same output but your suggestion re python script is a good idea. Should be fairly simple to implement via monitoring log file for " Detected objects:(OBJECT) (CONFIDENCE)" etc. I'll add it to my list of things to do unless someone beats me to it :)

Update: I found a work around: use mTail to monitor the log file, execute a cmd when match found. I use wget for windows and it executes a command to the URL that I need.
 
Last edited: