neilenns / node-deepstackai-trigger

Detects motion using Deepstack AI and calls registered triggers based on trigger rules.
MIT License
167 stars 28 forks source link

Changes to settings aren't getting detected #346

Closed neilenns closed 4 years ago

neilenns commented 4 years ago

I omitted the lines about images being skipped, but here's the log:

trigger_1 | 2020-07-16T12:49:48-05:00 [Main] **** trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Starting up version 5.1.1 trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Timezone offset is 300 trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Current time is Thu Jul 16 2020 12:49:48 GMT-0500 (Central Daylight Time) trigger_1 | 2020-07-16T12:49:48-05:00 [Settings] Loaded settings from /run/secrets/settings trigger_1 | 2020-07-16T12:49:48-05:00 [MQTT] Connected to MQTT server mqtt://10.0.0.88:1883 trigger_1 | 2020-07-16T12:49:48-05:00 [Local storage] Creating local storage folders in /node-deepstackai-trigger. trigger_1 | 2020-07-16T12:49:48-05:00 [Local storage] Enabling background purge every 60 minutes for files older than 30 minutes. trigger_1 | 2020-07-16T12:49:48-05:00 [Local storage] Running purge trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Annotated image generation enabled. trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Web server enabled. trigger_1 | 2020-07-16T12:49:48-05:00 [Triggers] Loaded configuration from /run/secrets/triggers trigger_1 | 2020-07-16T12:49:48-05:00 [Triggers] Loaded configuration for Front Driveway not cars trigger_1 | 2020-07-16T12:49:48-05:00 [Triggers] Loaded configuration for Front Driveway cars trigger_1 | 2020-07-16T12:49:48-05:00 [Triggers] Loaded configuration for North Road trigger_1 | 2020-07-16T12:49:48-05:00 [Trigger manager] There are 777 images waiting in /aiinput for Front Driveway not cars. trigger_1 | 2020-07-16T12:49:48-05:00 [Trigger manager] There are 777 images waiting in /aiinput for Front Driveway cars. trigger_1 | 2020-07-16T12:49:48-05:00 [Trigger manager] There are 777 images waiting in /aiinput for North Road. trigger_1 | 2020-07-16T12:49:48-05:00 [Pushbullet] Pushbullet is disabled via settings. trigger_1 | 2020-07-16T12:49:48-05:00 [Pushover] Pushover is disabled via settings. trigger_1 | 2020-07-16T12:49:48-05:00 [Telegram] Telegram is disabled via settings. trigger_1 | 2020-07-16T12:49:48-05:00 [Mqtt router] Subscribing to node-deepstackai-trigger/statistics/reset. trigger_1 | 2020-07-16T12:49:48-05:00 [Web server] Listening at http://localhost:4242 trigger_1 | 2020-07-16T12:49:48-05:00 [Local storage] Purge complete trigger_1 | 2020-07-16T12:49:48-05:00 [Mqtt router] Subscribing to node-deepstackai-trigger/statistics/trigger/reset. trigger_1 | 2020-07-16T12:49:48-05:00 [Mqtt router] Subscribing to node-deepstackai-trigger/motion. trigger_1 | 2020-07-16T12:49:48-05:00 [Trigger Front Driveway not cars] Listening for new images in /aiinput/drivewaysd.jpg trigger_1 | 2020-07-16T12:49:48-05:00 [Trigger Front Driveway cars] Listening for new images in /aiinput/drivewaysd.jpg trigger_1 | 2020-07-16T12:49:48-05:00 [Trigger North Road] Listening for new images in /aiinput/northroadSD*.jpg trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Watching for changes to /run/secrets/settings trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Watching for changes to /run/secrets/triggers trigger_1 | 2020-07-16T12:49:48-05:00 [Main] **** trigger_1 | 2020-07-16T12:49:48-05:00 [Main] Up and running! trigger_1 | 2020-07-16T12:49:49-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_065141376.jpg: Skipping as it was created before the service started. deepstack-ai_1 | [GIN] 2020/07/16 - 17:50:01 | 200 | 1.17227931s | 172.31.0.3 | POST /v1/vision/detection deepstack-ai_1 | [GIN] 2020/07/16 - 17:50:01 | 200 | 1.173287327s | 172.31.0.3 | POST /v1/vision/detection deepstack-ai_1 | [GIN] 2020/07/16 - 17:50:01 | 200 | 115.324531ms | 172.31.0.3 | POST /v1/vision/detection deepstack-ai_1 | [GIN] 2020/07/16 - 17:50:05 | 200 | 2.240648063s | 172.31.0.3 | POST /v1/vision/detection deepstack-ai_1 | [GIN] 2020/07/16 - 17:50:07 | 200 | 4.497818932s | 172.31.0.3 | POST /v1/vision/detection trigger_1 | 2020-07-16T12:49:56-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_124956037.jpg: Analyzing trigger_1 | 2020-07-16T12:50:00-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125000010.jpg: Analyzing trigger_1 | 2020-07-16T12:50:00-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125000010.jpg: Analyzing trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_125001063.jpg: Analyzing trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_124956037.jpg: Found at least one object in the photo. (4922 ms) trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_124956037.jpg: Matched triggering object car trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_124956037.jpg: Confidence 86.45112499999999 meets threshold 0 and 100 trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] Prediction region (518, 175, 558, 204) blocked by trigger mask (491, 165, 640, 209). trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_124956037.jpg: Not triggered by car (86.45112499999999) trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125000010.jpg: Analysis failed trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125000010.jpg: Analysis failed trigger_1 | 2020-07-16T12:50:01-05:00 [Trigger North Road] /aiinput/northroadSD.20200716_125001063.jpg: Analysis failed trigger_1 | 2020-07-16T12:50:03-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Analyzing trigger_1 | 2020-07-16T12:50:03-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Analyzing trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Found at least one object in the photo. (2253 ms) trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Detected object car is not in the watch objects list [person, cat, dog] trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Not triggered by car (78.36) trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Detected object car is not in the watch objects list [person, cat, dog] trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Not triggered by car (60.057559999999995) trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Detected object truck is not in the watch objects list [person, cat, dog] trigger_1 | 2020-07-16T12:50:05-05:00 [Trigger Front Driveway not cars] /aiinput/drivewaysd.20200716_125002539.jpg: Not triggered by truck (40.02356) trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Found at least one object in the photo. (4511 ms) trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Matched triggering object car trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Confidence 78.36 meets threshold 0 and 100 trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] Prediction region (136, 80, 526, 262) blocked by trigger mask (33, 85, 460, 251). trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Not triggered by car (78.36) trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Matched triggering object car trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Confidence 60.057559999999995 meets threshold 0 and 100 trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] Prediction region (256, 0, 301, 11) blocked by trigger mask (257, 0, 314, 16). trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Not triggered by car (60.057559999999995) trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Matched triggering object truck trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Confidence 40.02356 meets threshold 0 and 100 trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] Prediction region (175, 80, 532, 261) blocked by trigger mask (33, 85, 460, 251). trigger_1 | 2020-07-16T12:50:07-05:00 [Trigger Front Driveway cars] /aiinput/drivewaysd.20200716_125002539.jpg: Not triggered by truck (40.02356)

Originally posted by @minideezel in https://github.com/danecreekphotography/node-deepstackai-trigger/issues/345#issuecomment-659573004

neilenns commented 4 years ago

Can you tell me more information about your configuration?

  1. Are you running Docker directly on Windows? Or using something like Portainer/UnRaid/etc?
  2. Are you using secrets to mount the configuration files or mounting a folder with the config files in them? Post your docker-compose.yaml if you have one, thanks!
minideezel commented 4 years ago

Environment is:

Ubuntu 18.04.4 server
Docker version 19.03.6, build 369ce74a3c

Docker-compose:

version: "3.8"
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
      - ./aiinput:/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 https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.
      # The value to use is in the "TZ database name" column.
      - TZ=America/Chicago

    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:noavx
    restart: always
    ports:
      - 5000:5000
    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
neilenns commented 4 years ago

Interesting. I've never run this directly on Ubuntu (instead of on Windows Docker). It really shouldn't matter, since I use the same system to detect chanes to the settings files as I do for the new images arriving. I'm not sure what could be happening here. 🙁

crunchymetal commented 4 years ago

I'm having the same issue on Windows Docker; from what I can tell the secrets files are not being mapped correctly to the docker container. No matter what I put for a file location in the docker-compose file, if I CLI into the docker container there are the two default settings and triggers files under /run/secrets.

neilenns commented 4 years ago

@crunchymetal please open a new support issue for your situation and include the docker-compose.yaml file and a complete output log. Thanks!

crunchymetal commented 4 years ago

Oh my god I'm an idiot, I was editing an old copy of the files. Everything working as expected for me. Apologies for wasting your time.

neilenns commented 4 years ago

Been there, done that! 😂

neilenns commented 4 years ago

No response after two weeks, closing.

ghzgod commented 3 years ago

I know this issue is closed. How are people figuring out the coordinates to mask? Is there some software that is being used?

TrunkMonk commented 3 years ago

I know this issue is closed. How are people figuring out the coordinates to mask? Is there some software that is being used?

Paint.net will show cursor coordinates, you can get it here: https://www.getpaint.net/

neilenns commented 3 years ago

The built in Paint app in Windows 10 will also show you the x,y and width,height coordinates of a selection rectangle.

ghzgod commented 3 years ago

Awesome, I didn't want to ask a ridiculous question but I tried PS and it wasn't working out. I appreciate you both!