AI motion detection with BlueIris: an alternate approach

Anyway you can have it delete the images after they are processed by deepstack?

I've had the request before and resisted adding it. I don't believe the system should be responsible for managing files it didn't create.
 
If they were immediately deleted after processing then it would be difficult to investigate if needed to determine why something didn’t happen.

I have my input folder set to 5gb but will change it as I too found that in Windows explorer it was taking a long time to simply present the contents of the folder.
 
If my folder gets to 100 images, the CPU for the trigger docker goes up to 80% constant. Does yours do that?

I'm only experimenting with 1 camera, but I have 20 altogether....
 
No, mine currently has around 2000+ images but I do have the allocated space set to 5Gb.

EDIT Just checked, i have approx 4000+ files in my folder which occupies less than a gig. I’ve just reduced my storage limit to 1Gb so the BI automatically deletes older files.
 
Last edited:
If my folder gets to 100 images, the CPU for the trigger docker goes up to 80% constant. Does yours do that?

I'm only experimenting with 1 camera, but I have 20 altogether....

Please open a support request over on GitHub so I can look into this a bit. Make sure to include all the information requested in the support template. For reference, I have 5 cameras and only 80 images currently in my input folder and CPU usage is only 33% (from BlueIris).
 
Version 5.0.0 is out!

Breaking changes

  • statusTopic can no longer be set on the mqtt configuration in settings.json. Overall status messages are always sent to the node-deepstackai-trigger/status topic. This change aligns the status topic messages with the new MQTT messages that the system listens to for resetting statistics.

Non-breaking changes

  • Per-trigger statistics are now sent in new MQTT messages published to the node-deepstackai-trigger/statistics topic. The trigger name, triggered count and analyzed file count are included, as well as a formatted string version suitable for presentation to a user. The per-trigger statistics are also available as variables for mustache templates.
  • Statistics can be reset by publishing specific MQTT messages to the node-deepstackai-trigger/statistics topics and sub-topics.
  • Statistics can be read and reset via new REST APIs. Overall statistics are available at /statistics and per-trigger statistics are available at /statistics/triggerName. Statistics for all triggers can be retrieved from /statistics/all.
  • Triggers can be activated by sending node-deepstackai-trigger/motion MQTT messages with the name of the trigger in the message. This is similar to activating a trigger via the REST API and results in the trigger attempting to download a snapshot from the snapshotUri specified in the trigger's configuration.
  • Shutting down the system after a failed launch no longer throws an error.
  • The underlying Linux variant used for the Docker image is now node:slim.
  • Pushbullet is now included in the settings JSON schema.
To upgrade do docker-compose pull then docker-compose up to run with the new build. Unless you were using the statusTopic feature (and I'm guessing nobody was) there are no config changes necessary to upgrade.
 
  • Like
Reactions: Splat
Version 5.0.0 is out!

Breaking changes

  • statusTopic can no longer be set on the mqtt configuration in settings.json. Overall status messages are always sent to the node-deepstackai-trigger/status topic. This change aligns the status topic messages with the new MQTT messages that the system listens to for resetting statistics.

Non-breaking changes

  • Per-trigger statistics are now sent in new MQTT messages published to the node-deepstackai-trigger/statistics topic. The trigger name, triggered count and analyzed file count are included, as well as a formatted string version suitable for presentation to a user. The per-trigger statistics are also available as variables for mustache templates.
  • Statistics can be reset by publishing specific MQTT messages to the node-deepstackai-trigger/statistics topics and sub-topics.
  • Statistics can be read and reset via new REST APIs. Overall statistics are available at /statistics and per-trigger statistics are available at /statistics/triggerName. Statistics for all triggers can be retrieved from /statistics/all.
  • Triggers can be activated by sending node-deepstackai-trigger/motion MQTT messages with the name of the trigger in the message. This is similar to activating a trigger via the REST API and results in the trigger attempting to download a snapshot from the snapshotUri specified in the trigger's configuration.
  • Shutting down the system after a failed launch no longer throws an error.
  • The underlying Linux variant used for the Docker image is now node:slim.
  • Pushbullet is now included in the settings JSON schema.
To upgrade do docker-compose pull then docker-compose up to run with the new build. Unless you were using the statusTopic feature (and I'm guessing nobody was) there are no config changes necessary to upgrade.

Thanks for the update. Do you have samples code on how you setup your dashboard in HA? Also, if i reboot my mqtt server i get "[Main] Startup cancelled due to errors." Is it possible to keep retrying instead of having to restart container again?

2020-06-26T07:37:40-04:00 [Main] [MQTT] Unable to connect: connect ECONNREFUSED <ip>:1883 2020-06-26T07:37:40-04:00 [Main] **************************************** 2020-06-26T07:37:40-04:00 [Main] Startup cancelled due to errors. For troubleshooting assistance see https://github.com/danecreekphotography/node-deepstackai-trigger/wiki/Troubleshooting. 2020-06-26T07:37:40-04:00 [Main] Watching for changes to /run/secrets/settings
 
Thanks for the update. Do you have samples code on how you setup your dashboard in HA? Also, if i reboot my mqtt server i get "[Main] Startup cancelled due to errors." Is it possible to keep retrying instead of having to restart container again?

2020-06-26T07:37:40-04:00 [Main] [MQTT] Unable to connect: connect ECONNREFUSED <ip>:1883 2020-06-26T07:37:40-04:00 [Main] **************************************** 2020-06-26T07:37:40-04:00 [Main] Startup cancelled due to errors. For troubleshooting assistance see https://github.com/danecreekphotography/node-deepstackai-trigger/wiki/Troubleshooting. 2020-06-26T07:37:40-04:00 [Main] Watching for changes to /run/secrets/settings

I don't actually have any dashboard set up in HA that looks at the statistics. I don't care about them at all :D

Can you please open a support request in GitHub for the MQTT issue? Make sure you include the exact sequence of steps you take that lead to it (which services are rebooting, in what order, and where everything is installed).
 
It seems like CPU usage has increased considerably with version 5.0.

1593182800156.png



Anyone else having the same issue? CPU loads have increased 300%.
 
Last edited:
I just tried with v5.0.0 and v4.0.0 and don't see any difference in CPU usage. It hovers between 6-8% for "vmmem". I also tried with MQTT off (since that's where the substantial changes were in v5.0.0) and didn't see any difference.
 
Version 5.1.0 is out:

  • Warnings are now shown when annotateImage is true for a trigger handler but enableAnnotations wasn't set to true in the settings.json file.
  • Log messages are printed on startup to help confirm the image folder was mounted correctly with Docker.
  • Web server now shuts down properly when reloading settings.
  • Startup is now re-attempted if there are any failures during launch. Each re-attempt is 30 seconds apart and five re-attempts will happen before things are assumed to just be completely broken.
There are no breaking changes in this release. To update run docker-compose pull then docker-compose up.
 
  • Like
Reactions: Nashional
Anyone running it on a Synology NAS ? I'm wondering how fast it would be to analyze an image ?
I have an DS918+ for reference.
 
Hi all
I have tried many methods but cannot get it going
This is the output of the Deepstack Server
Code:
p
---------------------------------------
v1/restore
/v1/vision/detection
---------------------------------------
v1/vision/addmodel
--------------------------------------
v1/vision/listmodels
---------------------------------------
v1/vision/deletemodel
---------------------------------------
---------------------------------------
p
---------------------------------------
v1/restore

This is output of the Trigger Server
Code:
2020-07-02T09:20:14+01:00 [Main] Watching for changes to /run/secrets/settings
2020-07-02T09:20:14+01:00 [Main] Watching for changes to /run/secrets/triggers
2020-07-02T09:20:14+01:00 [Main] ****************************************
2020-07-02T09:20:14+01:00 [Main] Up and running!
2020-07-02T09:20:26+01:00 [Trigger Cat detector] /aiinput/Cat_20200523-075000 - Copy - Copy (2) - Copy - Copy.jpg: Analyzing
2020-07-02T09:20:26+01:00 [Trigger Cat detector] /aiinput/Cat_20200523-075100 - Copy - Copy (2) - Copy - Copy.jpg: Analyzing
2020-07-02T09:20:26+01:00 [Trigger Cat detector] /aiinput/Cat_20200523-074700 - Copy - Copy (2) - Copy - Copy.jpg: Analyzing
2020-07-02T09:20:26+01:00 [Trigger Dog detector] /aiinput/Dog_20200523-075000 - Copy - Copy (2) - Copy - Copy.jpg: Analyzing

For reference - the time now is 9:44
It never times out.. it never finishes analysis


In MQTT I can see the server is ONLINE
 
So that guide suggests using an SD feed for the images but when I tried using an SD substream I found that the object detection wasn’t as accurate as when using HD image?

Anybody else played around with SD versus HD?
 
Version 5.0.0 is out!

Breaking changes

  • statusTopic can no longer be set on the mqtt configuration in settings.json. Overall status messages are always sent to the node-deepstackai-trigger/status topic. This change aligns the status topic messages with the new MQTT messages that the system listens to for resetting statistics.

Non-breaking changes

  • Per-trigger statistics are now sent in new MQTT messages published to the node-deepstackai-trigger/statistics topic. The trigger name, triggered count and analyzed file count are included, as well as a formatted string version suitable for presentation to a user. The per-trigger statistics are also available as variables for mustache templates.
  • Statistics can be reset by publishing specific MQTT messages to the node-deepstackai-trigger/statistics topics and sub-topics.
  • Statistics can be read and reset via new REST APIs. Overall statistics are available at /statistics and per-trigger statistics are available at /statistics/triggerName. Statistics for all triggers can be retrieved from /statistics/all.
  • Triggers can be activated by sending node-deepstackai-trigger/motion MQTT messages with the name of the trigger in the message. This is similar to activating a trigger via the REST API and results in the trigger attempting to download a snapshot from the snapshotUri specified in the trigger's configuration.
  • Shutting down the system after a failed launch no longer throws an error.
  • The underlying Linux variant used for the Docker image is now node:slim.
  • Pushbullet is now included in the settings JSON schema.
To upgrade do docker-compose pull then docker-compose up to run with the new build. Unless you were using the statusTopic feature (and I'm guessing nobody was) there are no config changes necessary to upgrade.

When the container starts, it doesn't seem to do anything, i have setup triggers and settings, images folder via samba mount but container logs shows no activity.
I'd like to try "snapshotUri" instead watchPattern , can you say what "snapshotUri " i should use.
 
When the container starts, it doesn't seem to do anything, i have setup triggers and settings, images folder via samba mount but container logs shows no activity.
I'd like to try "snapshotUri" instead watchPattern , can you say what "snapshotUri " i should use.

See the troubleshooting page for help. If that still doesn't fix it open a GitHub support issue with the requested information.

You definitely do not want the snapshotUri feature. It's only useful for a very specific scenario and I'm confident that's not your scenario :)
 
I have @neile AI setup (Thank you @neile!) working on a Windows 10 machine and can see it reading the watch folder and trigger BI5 when I manually drop a jpg into that folder. Very cool.

Next, I have 2 Dahua cameras configured to ftp snapshot images to same Windows machine at C:\ftp. Note the sub folder structure Dahua cameras create and it seems that each Dahua camera type create different folder structure.

Screenshot (1).png

Question: Is there a way to configure watchPattern in triggers.json to recursively check for any new jpg in any subfolders under C:\ftp?
 
Last edited: