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

Telegram annotateImage not working #332

Closed melvinraju closed 4 years ago

melvinraju commented 4 years ago

Describe the bug "annotateImage": true has been set but the received image is not annotated Here's an example: IMG_2755

Log entries

2020-06-29T19:50:24+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Analyzing

2020-06-29T19:50:24+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-22.jpg: Analyzing

2020-06-29T19:50:26+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-23.jpg: Analyzing

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Found at least one object in the photo. (5264 ms)

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Matched triggering object person

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Confidence 53.64246 wasn't between threshold 60 and 100

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Not triggered by person (53.64246)

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Matched triggering object car

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Confidence 99.797267 meets threshold 60 and 100

2020-06-29T19:50:29+01:00 [Trigger Hallway] /aiinput/YiHome_18-50-21.jpg: Triggered by car (99.797267)

2020-06-29T19:50:29+01:00 [Telegram] Sending message to -*********

Installation details

neilenns commented 4 years ago

Weird. Please post your whole docker compose and trigger file. Thanks!

melvinraju commented 4 years ago

Archive.zip

neilenns commented 4 years ago

Thanks, will look later today. For sure that I handled promise rejection is something I should be catching.

neilenns commented 4 years ago

Forgot: can you also include your settings.json file?

neilenns commented 4 years ago

I tried annotated Telegram messages just now and it worked fine. My guess is you haven't enabled annotated image generation in your settings.json file by adding this:

enableAnnotations: true

Since annotations have a performance penalty associated with them it has to explicitly be turned on. If they aren't on, even if you request it on the Telegram handler, just the unannotated image gets sent.

If you do a docker-compose pull to get the latest dev tagged image there's new warning messages in the logs to notify about this situation.

melvinraju commented 4 years ago

Cool! Got the error using the dev image. Would be good to include that in the sample config settings.json and default it to false. Thanks for the help again!

neilenns commented 4 years ago

Good idea, done!