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

I'm using AI Tools VorlonCD , Need assistance with Telegram to send photo alerts. Started an acct with Telegram, made a group, got chatid and also token. Unable to sent alerts and have attempted to troubleshoot the errors in the logs. The images are sent to the folder C:/AI Tools/ error. The file resolution was lowered to 1280x720 and file size is approx 600KB . Any assistance is appreciated with this issue and anything identified in the logs. The upload is partial, can upload full if needed. Thanks.

[30.08.2020, 04:28:14.565]: DetectObjects> 127.0.0.1:83 - (Error: No predictions? JSON: '{"success":false,"error":"invalid image"}')
[30.08.2020, 04:28:14.583]: DetectObjects> 127.0.0.1:83 - ERROR: Failure response from DeepStack. JSON: '{"success":false,"error":"invalid image"}'
[30.08.2020, 04:28:14.683]: TelegramUpload> uploading image to chat "405397243"
[30.08.2020, 04:28:15.631]: TelegramText> ERROR: Could not send text "[30.08.2020, 04:28:14.583]: 127.0.0.1:83 - ERROR: Failure response from DeepStack. JSON: '{"success":false,"error":"invalid image"}'" to Telegram.

A few thoughts.
  • Both deepstack and telegram seem to think the image C:\AI_Input\MNHD.20200830_043459407.jpg is invalid. Or perhaps it cannot access it because it is still being written/accessed. Seems less likely since my code waits for full read-write access of the image before sending to deepstack.
  • Try disabling the feature in BI that lowers the DPI, leave it along and see if that helps. Maybe BI isnt create a valid image or its holding the file open too long.
  • Can you manually view images that fail?
  • Plenty of drive space free?
  • Anything special about the C:\AI_INPUT folder? Is it a hardlink/junction? Are there a bajillion images in that folder? Is it SSD or mechanical drive? (Each camera should have its own folder now, and disable the input path on main settings screen)
  • At an admin command line run CHKDSK /f C: and press enter. Let it run on restart, then restart the machine. Maybe something logical wrong with the drive.
 
@Chris Dodge
Just checking out the cancel flag but unable get past the error in the log. I have confirmed that the command to BI is accepted. This what I am sending

[21:56:31.665]: OnCreatedAsync> Adding new image to queue: E:\BlueIris\AI_Input\Drive.20200830_215631624.jpg
[21:56:31.674]: ImageQueueLoop> Adding task #1 for file 'Drive.20200830_215631624.jpg' on URL ''
[21:56:31.677]: ImageQueueLoop> Waiting for any of 1 tasks to get done...
[21:56:31.693]: DetectObjects> 127.0.0.1:82 - Starting analysis of E:\BlueIris\AI_Input\Drive.20200830_215631624.jpg...
[21:56:31.695]: DetectObjects> 127.0.0.1:82 - (1/6) Uploading image to DeepQuestAI Server at [21:56:34.003]: DetectObjects> 127.0.0.1:82 - (2/6) Posted in 2279ms, Received a 33 byte response.
[21:56:34.006]: DetectObjects> 127.0.0.1:82 - (3/6) Processing results...
[21:56:34.009]: DetectObjects> 127.0.0.1:82 - Detected objects:
[21:56:34.011]: DetectObjects> 127.0.0.1:82 - (5/6) Performing alert CANCEL actions:
[21:56:34.020]: Trigger> Index was out of range. Must be non-negative and less than the size of the collection. | Parameter name: index [ArgumentOutOfRangeException] Mod: <Trigger>d__25 Line:1115:29
[21:56:34.031]: CallTriggerURLs> ERROR: Could not trigger URL '', please check if '' is correct and reachable: Value cannot be null. | Parameter name: address [ArgumentNullException] Mod: CallTriggerURLs(String[] trigger_urls) Line:993:21
[21:56:34.088]: Save> Settings saved to C:\Users\Chris\Documents\AI Tool\Release\AITool.Settings.json
[21:56:34.088]: DetectObjects> 127.0.0.1:82 - (6/6) Camera Drive caused a false alert, nothing detected.
[21:56:34.102]: DetectObjects> 127.0.0.1:82 - Adding false to history list.
[21:56:34.113]: DetectObjects> 127.0.0.1:82 - ...Object detection finished:
[21:56:34.115]: DetectObjects> 127.0.0.1:82 - Total Time: 2432ms (Count=1, Min=2432ms, Max=2432ms, Avg=2432ms)
[21:56:34.118]: DetectObjects> 127.0.0.1:82 - DeepStack Time: 2279ms (Count=1, Min=2279ms, Max=2279ms, Avg=2279ms)
[21:56:34.121]: DetectObjects> 127.0.0.1:82 - File lock Time: 0ms (Count=0, Min=0ms, Max=0ms, Avg=ms)
[21:56:34.123]: DetectObjects> 127.0.0.1:82 - Image Queue Time: 12ms (Count=1, Min=12ms, Max=12ms, Avg=12ms)
[21:56:34.127]: DetectObjects> 127.0.0.1:82 - Image Queue Depth: 1 (Count=1, Min=1, Max=1, Avg=1)
[21:56:34.132]: ImageQueueLoop> ...Task at index 0 done.
[21:56:34.134]: ImageQueueLoop> Done processing current image queue.
 
Our new mod of AITOOL lets you specify as many DeepStack URL's as you like in settings. If you have more than one image in the queue, they will be processed in parallel in each deepstack server.
The log does get a little more complicated to view since results from each URL are mixed together, but it seems to work well from my initial testing. (@GentlePumpkin )

I'm using this version right now and it works great! I have deepstack running on my unraid server and BI running on my gaming desktop (will soon change this to my unraid server). The dynamic mask is a game changer, IMO. You can fine tune the settings quite a bit.

Dynamic masks, along with crosses zones and object triggers, make it to where I don't think I've gotten one false alert, nor has AITool missed something that has happened in my yard. My neighbors move their vehicle to their driveway/street so my mask might not always be in the same place.

Lastly, I did notice that if you do get a LOT of trigger events then this does seem a bit slower to process the images vs the original AITool. Though this doesn't seem to be an issue with dynamic masks disabled. However, this is also when processing a ton of images, so using a combination of AI, zones, and motion detection... you should most likely be able to get a VERY fast and 95% accurate alerts/recording events.

Thanks so much for such an awesome fork of this tool!

Edit: Just wanted to follow up. I'm sure I need to tweak some of my dynamic mask settings, however, when getting multiple triggers (3-5 pictures or more) then it does seem to process significantly slower. Though the first 1-2 pictures get processed quickly. I'll keep testing as I get more multiple screenshots to scan at once.
 
Last edited:
A few thoughts.
  • Both deepstack and telegram seem to think the image C:\AI_Input\MNHD.20200830_043459407.jpg is invalid. Or perhaps it cannot access it because it is still being written/accessed. Seems less likely since my code waits for full read-write access of the image before sending to deepstack.
  • Try disabling the feature in BI that lowers the DPI, leave it along and see if that helps. Maybe BI isnt create a valid image or its holding the file open too long.
  • Can you manually view images that fail?
  • Plenty of drive space free?
  • Anything special about the C:\AI_INPUT folder? Is it a hardlink/junction? Are there a bajillion images in that folder? Is it SSD or mechanical drive? (Each camera should have its own folder now, and disable the input path on main settings screen)
  • At an admin command line run CHKDSK /f C: and press enter. Let it run on restart, then restart the machine. Maybe something logical wrong with the drive.
Thanks, for taking the time to respond. Will implement the suggested troubleshooting methods. To answer your ?s, yes I can see the images. The files are sent to a folder C:\AI Tools\errors . The drive is SSD, with 56 GB free. Hardlink? All data is located on c: drive. I try to keep the images to a minimal by manually deleting files. (<150) while TS issue). Thanks again for taking the time!!
 

Attachments

  • TELEGRAM-ERROR-MNHD.20200830_121252595.jpg.jpg
    TELEGRAM-ERROR-MNHD.20200830_121252595.jpg.jpg
    701.4 KB · Views: 34
@Chris Dodge love your fork, saved me alot of time trying to do it myself since I'm terrible in c... couple of ideas that could be good :
1. Option to include original alert image, or the image with the ai boxes (save some time when you get an alert and can see what it thinks is there)
2. For telegram a max message per time option. My s/o likes to talk with her mom in the driveway and send 20 telegram alerts in 30 seconds.

Thanks again for a great fork
 
@Chris Dodge love your fork, saved me alot of time trying to do it myself since I'm terrible in c... couple of ideas that could be good :
1. Option to include original alert image, or the image with the ai boxes (save some time when you get an alert and can see what it thinks is there)
2. For telegram a max message per time option. My s/o likes to talk with her mom in the driveway and send 20 telegram alerts in 30 seconds.

Thanks again for a great fork
Another suggestion
as i'm running AITool in service, it'll be very good to have a webinterface :)
 
  • Like
Reactions: Village Guy
A few small updates to the VorlonCD fork of this tool...

Please log issues and feature requests for this fork on Github - Try to include as much detail as you can. Pretty hard to keep up with this monster thread.

@WingSuit - After installing the latest version, run it once, close the app and edit AITOOL.SETTINGS.JSON in notepad - change "telegram_cooldown_minutes" to whatever you like. Will need to research option to include original alert image.

@VLITKOWSKI , @Village Guy, @warbux - Creating a true service and web interface is great idea, but big undertaking. I will look into this when I have time. As an partial alternative, DISABLE the NSSM service, enable "Start with user login" in settings, and google for "How to turn on automatic logon in Windows". Using NSSM isnt really a great solution because then when you open a second GUI instance to watch results or change settings, there is a lot of "fighting" for file access of the config and history files.

The correct way to use the NSSM service right now is to STOP the service before opening the GUI version to view history or change settings. Then when done, close the GUI and restart the service.

@Jim davis - I changed a few things around that may help for the invalid image/telegram error. At the very least, a bit more info in the log should appear.

 
  • Like
Reactions: WingSuit
Last edited:
cepler, The "-" was the issue. Haven't been this elated, since after prom night with keys to a motel room in 1981!. Thanks for the solution to my woes and also a shoutout for the great works you guys do. Volandcd fork, has been a godsend.
 
I know a few of you are running deepstack on a raspberry pi, any feedback on reliability? My celeron NUC isn't cutting it. Docker on windows 10 it does a 720p res image in about 5 seconds. In the VM I originally had it took 20plus seconds. I see some feedback about the pi and NCS2 running in under a second, so looking for some feedback before I go down that route. It appears it's still in alpha
 
I know a few of you are running deepstack on a raspberry pi, any feedback on reliability? My celeron NUC isn't cutting it. Docker on windows 10 it does a 720p res image in about 5 seconds. In the VM I originally had it took 20plus seconds. I see some feedback about the pi and NCS2 running in under a second, so looking for some feedback before I go down that route. It appears it's still in alpha
I ordered the bits last week to do it and will let you know once they arrive at the end of the week and I've tested it..
 
  • Like
Reactions: Eatoff
I know a few of you are running deepstack on a raspberry pi, any feedback on reliability? My celeron NUC isn't cutting it. Docker on windows 10 it does a 720p res image in about 5 seconds. In the VM I originally had it took 20plus seconds. I see some feedback about the pi and NCS2 running in under a second, so looking for some feedback before I go down that route. It appears it's still in alpha

This is from the DeepStack forum. I'm quite interested in the Jetson version. I envision a couple of Jetsons sitting on top of my BI machine.

"Hello we are planning on releasing an embedded version of DeepStack as a docker image on the Nvidia Jetson nano. Support for a stable version of DeepStack on the pi is still on the radar, however we are considering the performance limits and might instead go all in on the jetson which comes at a better price when the cost of the ncs is added to that of the pi, while still offering better performance."

DeepStack Beta Release
 
Last edited:
I have just set this up on my BI server and am seeing a lot of these errors:
[02.09.2020, 15:01:24]: ...Putting image back in queue due to URL '' failure (ErrCount=0): 'D:\Images\SideYardSD.20200902_150123487.jpg'
[02.09.2020, 15:01:25]: Value cannot be null. | Parameter name: stringToEscape [ArgumentNullException] Mod: <Trigger>d__25 Line:1129:29
[02.09.2020, 15:01:29]: Value cannot be null. | Parameter name: stringToEscape [ArgumentNullException] Mod: <Trigger>d__25 Line:1129:29
[02.09.2020, 15:01:34]: 127.0.0.1:88 - (Error: No predictions? JSON: '{"success":false,"error":"invalid image"}')
[02.09.2020, 15:01:34]: 127.0.0.1:88 - ERROR: Failure response from DeepStack. JSON: '{"success":false,"error":"invalid image"}'
[02.09.2020, 15:01:34]: ...Putting image back in queue due to URL '' failure (ErrCount=0): 'D:\Images\SideYardSD.20200902_150133487.jpg'
[02.09.2020, 15:01:35]: Value cannot be null. | Parameter name: stringToEscape [ArgumentNullException] Mod: <Trigger>d__25 Line:1129:29
 
This is from the DeepStack forum. I'm quite interested in the Jetson version. I envision a couple of Jetsons sitting on top of my BI machine.

"Hello we are planning on releasing an embedded version of DeepStack as a docker image on the Nvidia Jetson nano. Support for a stable version of DeepStack on the pi is still on the radar, however we are considering the performance limits and might instead go all in on the jetson which comes at a better price when the cost of the ncs is added to that of the pi, while still offering better performance."

DeepStack Beta Release
Thanks for that quote. That's pretty disappointing as I just ordered the Intel stick... Maybe I'll go the route or upgrading from a celeron to an i5 instead.

Has anyone done a comparison between the noavx docker container and the regular container? What sort of performance increase does avx bring (all other things being equal)? I don't have a avx capable system to test on

Edit: actually, reading that forum link you posted, there should have been a stable release for the Pi released end of August, so can't be too far off. And one user reporting faster times from his Pi than from his i5, so that's promising
 
Last edited:
Edit: actually, reading that forum link you posted, there should have been a stable release for the Pi released end of August, so can't be too far off. And one user reporting faster times from his Pi than from his i5, so that's promising

I don't put much faith into the release date estimates in that thread. On July 8th the developers said that they were considering going "all in" on the Jetson which suggests to me that they would abandon the Pi or at least treat it with low priority. They didn't seem too hot on the Pi, and then four days later on the 12th they said they were going to release a stable version for the Pi soon. It sounds to me like they aren't quite sure of their direction. I have a Jetson Nano in my Amazon cart but I'm not pulling the trigger until I see at least some version of DeepStack available for the Jetson platform. Alpha, Beta, or otherwise.

The people calling for Pi support seem to be doing so because they have already invested in the hardware or perhaps they just have more experience with the Pi and are more comfortable using it. However, since the Jetson is less expensive and more powerful than the Pi with an NCS it makes better sense to me for the developers to focus their efforts toward the Jetson platform.

There's an interesting video on YouTube showing a Jetson Nano running DeepStream doing object detection on 8 video streams simultaneously.

 
They didn't seem too hot on the Pi, and then four days later on the 12th they said they were going to release a stable version for the Pi soon. It sounds to me like they aren't quite sure of their direction

Yeah, the more I read, the more I worry about the maturity. I know it's free and all, but perhaps the tensorflow AI is a bit more mature at this stage. I should have held off on the NCS2, but lesson learnt