AI motion detection with BlueIris: an alternate approach

lyfskills

n3wb
Joined
Dec 24, 2019
Messages
2
Reaction score
0
Location
ohio
Really appreciate the work on this!

I am very close to having this work with Synology Surveillance Station using some action rules. I am trying to use snapshotUri's to grab a snapshot from Surveillance Station. The problem I'm running into is that you must first auth with the Synology:


Then you can use this to grab a jpg:


What would it take to have this trigger two snapshotUri's?

Thanks in advance for any assistance!

EDIT: I created a quick Python script to accomplish this. I'll be sharing soon!
 
Last edited:

Yangrek

n3wb
Joined
Feb 4, 2020
Messages
14
Reaction score
2
Location
Belarus
Current version: 5.1.1, released July 12, 2020.

A few weeks ago I came across The Hook Up's video on how to use gentlepumkin's now famous thread to set up AI motion detection with BlueIris. This sent me down the path of building a new PC, buying BlueIris, migrating all my IP cameras from Synology Surveillance Station, and getting the AI Tool up and running.

While I eventually did get everything working and saw the potential I wanted something that could run as a Docker container. I also missed not having MQTT notifications as part of the system. I know it's possible to set up BlueIris to do the MQTT sending but I wanted the messages earlier in the flow so I could use Home Assistant + NodeRed to decide when it was appropriate to turn on high-resolution recording (e.g. if I'm outside enjoying my deck I don't need the HD feed constantly triggering).

I'm happy to release node-deepstackai-trigger, a Docker image that offers:
  • AI detection using DeepStack.ai (inspired by gentlepumpkin's idea and initial implementation)
  • Initial configuration and installation with just two files
  • Mask regions to block sections of the image that are prone to false positives
  • Support for web requests to trigger BlueIris camera recording
  • Support for sending MQTT messages, including motion end events for nice integration with Home Assistant MQTT binary sensors
  • Support for sending Pushbullet, Pushover and Telegram messages
  • REST API for activating a trigger from an external system and retrieving statistics
  • MQTT topics for activating a trigger from an external system and retrieving statistics
From the start I worked hard to make installation and configuration as quick as possible. If you already have your BlueIris cameras configured for the AI Tool solution then you just need to copy two files locally to your machine, define your triggers in the configuration file, then run docker-compose up. There's no need to independently install or configure Deepstack.ai: it's all taken care of for you. (If you already have Deepstack.ai running as a container you'll want to stop it to save CPU time. No need to have two copies running!)

Interested in taking it for a spin? Quick start instructions are available in the readme. Complete instructions are on the project wiki, including a complete write-up of the different configuration options and detailed steps for setting up cameras in BlueIris if you haven't done so already.

Hope you find this useful!

P.S. If you're the type that likes to hack at code the project is designed to get up and running for development in less than five minutes. See the contributing guide for the magic. Happy hacking!
Hello, I'm new to this stuff and I'm trying to install and test this beautiful thing through Docker Toolbox. I have copied docker-compose.yml, settings.json and triggers.json into docker toolbox folder and run docker-compose up and get following error:


docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at Docker Documentation


Start interactive shell

Веледниково@▒▒▒▒▒▒▒▒▒▒▒-▒▒ MINGW64 /c/Program Files/Docker Toolbox
$ docker-compose up
ERROR: Version in ".\docker-compose.yml" is unsupported. You might be seeing thi
s error because you're using the wrong Compose file version. Either specify a su
pported version (e.g "2.2" or "3.3") and place your service definitions under th
e services key, or omit the version key and place your service definitions a
t the root of the file to use version 1.
For more on the Compose file format versions, see e/compose-file/

Веледниково@▒▒▒▒▒▒▒▒▒▒▒-▒▒ MINGW64 /c/Program Files/Docker Toolbox
$

What am I doing wrong?
 
Joined
Oct 25, 2016
Messages
5
Reaction score
2
Location
Ireland
Hello, I'm new to this stuff and I'm trying to install and test this beautiful thing through Docker Toolbox. I have copied docker-compose.yml, settings.json and triggers.json into docker toolbox folder and run docker-compose up and get following error:


docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at Docker Documentation


Start interactive shell

Веледниково@▒▒▒▒▒▒▒▒▒▒▒-▒▒ MINGW64 /c/Program Files/Docker Toolbox
$ docker-compose up
ERROR: Version in ".\docker-compose.yml" is unsupported. You might be seeing thi
s error because you're using the wrong Compose file version. Either specify a su
pported version (e.g "2.2" or "3.3") and place your service definitions under th
e services key, or omit the version key and place your service definitions a
t the root of the file to use version 1.
For more on the Compose file format versions, see e/compose-file/

Веледниково@▒▒▒▒▒▒▒▒▒▒▒-▒▒ MINGW64 /c/Program Files/Docker Toolbox
$

What am I doing wrong?
At the top of the docker-compose.yaml

change the version to match yours 3.3
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67

Yangrek

n3wb
Joined
Feb 4, 2020
Messages
14
Reaction score
2
Location
Belarus
At the top of the docker-compose.yaml

change the version to match yours 3.3
And then it gives error:

$ docker-compose up
dockertoolbox_deepstack-ai_1 is up-to-date
Creating dockertoolbox_trigger_1 ... error

ERROR: for dockertoolbox_trigger_1 Cannot create container for service trigger:
invalid mount config for type "bind": invalid mount path: 'C:/Program Files/Doc
ker Toolbox/triggers.json' mount path must be absolute

ERROR: for trigger Cannot create container for service trigger: invalid mount c
onfig for type "bind": invalid mount path: 'C:/Program Files/Docker Toolbox/trig
gers.json' mount path must be absolute
ERROR: Encountered errors while bringing up the project.

I have tried to change WatchPattern Path to absolute but it won't help...
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Your mount point is incorrect. Post your entire docker-compose.yaml so we can see what you have.
 

Yangrek

n3wb
Joined
Feb 4, 2020
Messages
14
Reaction score
2
Location
Belarus
Your mount point is incorrect. Post your entire docker-compose.yaml so we can see what you have.
version: "3.3"
services:
trigger:
volumes:
# Change d:/myfolder/myimages to point to the folder that will have the images
# to analyze. Only change the local path that is before the :/aiinput portion.
# Don't change the :/aiinput part. For example, if you are on Windows and your
# images are stored locally in d:/blueiris/capturedImages your final line should
# look like this:
# d:/blueIris/capturedImages:/aiinput
- d:/BlueIris/ai input:/aiinput

environment:
# Change this to match the timezone the images are produced in,
# Typically this will be the timezone of the machine running
# the Docker container. For a list of valid timezone values
# see List of tz database time zones - Wikipedia.
# The value to use is in the "TZ database name" column.
- TZ=America/Los_Angeles

ports:
# This port is used by the local web server when annotated images are enabled.
# If you change the port used by the local web server in the settings.json file
# this also has to change to match.
- 4242:4242

# ------------------------------------------------------------------------
# Don't change anything below this line unless you know what you are doing
secrets:
- triggers
- settings
image: danecreekphotography/node-deepstackai-trigger:latest
restart: always
depends_on:
- deepstack-ai

deepstack-ai:
image: deepquestai/deepstack:latest
restart: always
volumes:
- localstorage:/datastore
environment:
- VISION-DETECTION=True

volumes:
localstorage:

secrets:
settings:
# This should point to the location of the settings.json configuration file
file: ./settings.json
triggers:
# This should point to the location of the triggers.json configuration file
file: ./triggers.json

Path to image folder is (where images are stored):
D:\BlueIris\AI Input
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Are you running docker-compose up from within the folder that has all three files (docker-compose.yaml, triggers.json, and settings.json) in it?
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
Please open a support request over on GitHub for assistance with this. It's very likely because you are on Docker Toolbox and you'll have to change parts of the compose file to not use secrets. When opening the support request make sure to include the complete docker-compose.yaml file and the output logs from docker-compose up.
 

stk21

n3wb
Joined
Jul 5, 2020
Messages
4
Reaction score
3
Location
CO
Really appreciate the work on this!

I am very close to having this work with Synology Surveillance Station using some action rules. I am trying to use snapshotUri's to grab a snapshot from Surveillance Station. The problem I'm running into is that you must first auth with the Synology:


Then you can use this to grab a jpg:


What would it take to have this trigger two snapshotUri's?

Thanks in advance for any assistance!

EDIT: I created a quick Python script to accomplish this. I'll be sharing soon!
I havent tested this but you could just have two web calls

The first one for auth, the second one for he snapshot.

I use Synology Surveillance Station and this is how I have my setup.
When a camera detects motion, I have an action rule to take a series of snapshots and deposit them into a different folder than the video files.
This folder is also a NFS share that is mounted to my docker host, and i have that specific volume ported into the node_ai container. which the program looks at based on the naming of the files.
If it detects whatever I am looking for I sent an MQTT message to the broker (which I am not doing anything with just yet), and I also send a pushover message with the image to my phone.

The synology system cleans up the files in the share, so there are only about 1 days of snapshots in that folder. I am not relying on the AI trigger to take snapshots.

The interval that I am taking my snapshots if every 5 seconds. Which has been fine for what I am looking for.

I have a different setup on my front door. I have the same setup for that with an image every 5 seconds, but I also have an action rule in synology that when the camera detects motion it takes a snapshot every 1 second. This will ensure I get face photos. I dont use this logic on the driveway camera as there are trees in the image that are always blowing and I dont want it to be taking snap every second.

I think I covered this. I am happy to assist with the synology setup as that is what I am using.
 

stk21

n3wb
Joined
Jul 5, 2020
Messages
4
Reaction score
3
Location
CO
I have a possible request. Just to see if it is something that is worth doing. Probably not as the data is already there.

Most of the camera feeds have a date/time stamp on them. might it be possible to also add the date/time stamp from the program next to the box and percentage annotation?

The reason for the request is after the containers have been running for about 3 days, I will start getting a delay in the pushover messages up to an hour. Now this may be a pushover issue, or something locally. Which is why I think having the date/time from the image, plus the date/time from when the AI engine actual annotated the image.

Thoughts?

Great program, and thank you.

Doug
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
I have a possible request. Just to see if it is something that is worth doing. Probably not as the data is already there.
There's a ton of logging already produced by the system to see where the delay is. What I suggest doing is just walking outside to trigger one of your cameras and then checking the logs in Docker to see when the image is received by the system, when it is processed for detection, and when the pushover notification is sent.
 

cokipuff20

n3wb
Joined
Jul 15, 2020
Messages
6
Reaction score
0
Location
usa
hello

i have configured AITtool and BlueIris on windows and everything worked well.

but i would like to try this.

i'm using proxmox and have created a new ubuntu LCX with docker/portainer. I pulled danecreekphotography/node-deepstackai-trigger:latest but then got stuck as i'm not sure how configure docker-compose.yaml, triggers.json, and settings.json next. if you guys can help guide me, thanks so much.
 

neile

Getting the hang of it
Joined
May 15, 2020
Messages
132
Reaction score
67
hello

i have configured AITtool and BlueIris on windows and everything worked well.

but i would like to try this.

i'm using proxmox and have created a new ubuntu LCX with docker/portainer. I pulled danecreekphotography/node-deepstackai-trigger:latest but then got stuck as i'm not sure how configure docker-compose.yaml, triggers.json, and settings.json next. if you guys can help guide me, thanks so much.
There is some information on setting up with Portainer in the open issue to document how to do it: Document how to set this up with Portainer · Issue #184 · danecreekphotography/node-deepstackai-trigger. I've never used Portainer before however so my ability to assist is limited.

As in other times this has come up I strongly recommend not messing around with extra crap on top of Docker. Just use straight Docker, installed on the same machine that's running Windows and BlueIris. Every extra VM and management layer you add just makes things more complicated and harder to configure.
 

cokipuff20

n3wb
Joined
Jul 15, 2020
Messages
6
Reaction score
0
Location
usa
There is some information on setting up with Portainer in the open issue to document how to do it: Document how to set this up with Portainer · Issue #184 · danecreekphotography/node-deepstackai-trigger. I've never used Portainer before however so my ability to assist is limited.

As in other times this has come up I strongly recommend not messing around with extra crap on top of Docker. Just use straight Docker, installed on the same machine that's running Windows and BlueIris. Every extra VM and management layer you add just makes things more complicated and harder to configure.
thanks so much. i played around with that guide . i also posted a response how i got everything to work.
 

shannondalebreaux

Getting the hang of it
Joined
Jun 6, 2018
Messages
82
Reaction score
29
Location
louisana
Has any one tried to integrate this yolo with the BI and Ai tool? Would it make the Ai tool even more accurate if it was possible to get yolo to work with?

Sent from my SM-G965U using Tapatalk
 
Top