jakowenko / double-take

Unified UI and API for processing and training images for facial recognition.
https://hub.docker.com/r/jakowenko/double-take
MIT License
1.2k stars 94 forks source link

double-take with unifi nvr and #229

Open kingunlim opened 2 years ago

kingunlim commented 2 years ago

Hello, i wanted to ask if there is maybe a possibility to use double-take with unifi protect? i saw that someone managed to make a addon for mqtt and also recently updated it to make use of the smart detections: https://github.com/terafin/mqtt-unifi-protect-bridge

image

i saw that double take forces to use frigate, so i would think it would some tweaks from your site?

or maybe you have a other idea to realize this?

i also find this: https://github.com/briis/pyunifiprotect

and i also already have the unifi-protect addon for home assistant, this addon can do so much - it also register if a car or person is registerd and can do something when this happens - so maybe also there is a possibility?

here is also the documentation of the api: https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/docs/ProtectAPI.md

i just saw your other post regarding unifi and the possibility to integrate it, so maybe you are interestet or know something that could work?

best regards

NickM-27 commented 2 years ago

Similar issue with some tips on how to do this today manually

jakowenko commented 2 years ago

If you want to go the MQTT route, you'll need to find an integration that publishes a jpeg encoded image. This is what Frigate does and how Double Take processes the MQTT image.

The cameras part of the docs show how you can setup a camera to listen for a custom topic. As Nick mentioned, there's a couple issues that reference how to set it up. The mqtt-unifi-protect-bridge topics seem more related to the state of the sensor rather than the actual image from the camera. If you can find a unifi project that exposes an image or writes it somewhere where DT can pick it up, I can look into building a more direct integration.

jakowenko commented 2 years ago

@kingunlim, the docs here https://github.com/hjdhjd/homebridge-unifi-protect/blob/main/docs/MQTT.md#homekit-support-for-the-unifi-protect-ecosystem-using-homebridge show that it's possible to publish snapshot events, including publishing the actual images over MQTT. So if you can get that working, then Double Take should be able to process those.

kingunlim commented 2 years ago

thanks for your answers!

Hmm... so the easiest route would be to try homebridge, i can configure it and then i will see how that works, atm i use the scrypted docker to bring my unifi cameras to homekit secure video, but if double take works together with homebridge for the snapshot feature than i will change to homebridge. do you also see the other addons i post, just wanted to ask if you see something with a snapshot feature there?

thanks and best regards

kingunlim commented 2 years ago

@jakowenko i configured the homebridge addon + mqtt broker, maybe you can give me a advice how the config file for double-take would need to look like to work and listen to the mqtt events? as i said, i would think that i don't need frigate for this? because the smart alerts should be carried over to mqtt via the homebridge addon?

image
NickM-27 commented 2 years ago

Would need to see the MQTT topics and then can suggest from there

kingunlim commented 2 years ago

alright, so the log from the mosquitto broker from homeassistant would be enough? I'll post them when i come home from work ok?

NickM-27 commented 2 years ago

I think so, that or MQTT explorer view

kingunlim commented 2 years ago

alright, checked my config again, and i have some troubles for the connection from my homebridge (extra raspberry) to my homeassistant (mqtt broker)- also extra raspberry. now everything works, but i think i need to configure the snapshot function somewhere? is it right to conifgure it here?

image

so, for instance i asume:

image

but as i write i would think thats not the right place, so i assume somewhere in the config from the homebridge unfi protect plugin?

also i don't know if its neccessary to configure for example one cam via homekit controller - like my appletv or homeassistant, so that it works at all?

kingunlim commented 2 years ago

and maybe someone can guide me along, how to prober config it after mqtt, so i think the developer says i can use the local snapshot that my unifi protect smart system triggers and homebridge will then listen for this event and triggers the snapshot - now double-take must somewhere listen to this special event and then create the picture, so i need a detector?

i see in the readme of double-take, that the topic it listens to is:

image

so should i configure my homebridge mqtt topic to this topic frigate/events vs the standard: unifi/protect?

as you see guys im at lost and really need your help, i would also consider it not to be free if someone is willing.

thx

kingunlim commented 2 years ago

maybe someone is willing to help me out here?

kingunlim commented 2 years ago

hmmm 🤔 no one?

townsmcp commented 1 year ago

Just saw this thread and the Unifi HomeBridge update with HKSV but more importantly the HomeBridge plugin works with MQTT including saving the motion image to MQTT (see here). I am about to order some Unifi kit (doorbell and G4 Instant to replace Arlo HD Pro 2 and Nest Hello) so I’ve been trying to do research into see if having a Unifi doorbell will be quicker person detection and recognition rather than the Nest Hello into Frigate and then out to another tool and utilising Double Take to glue everything together. I’ve also noticed DeepStack has gone

kingunlim commented 1 year ago

Just saw this thread and the Unifi HomeBridge update with HKSV but more importantly the HomeBridge plugin works with MQTT including saving the motion image to MQTT (see here). I am about to order some Unifi kit (doorbell and G4 Instant to replace Arlo HD Pro 2 and Nest Hello) so I’ve been trying to do research into see if having a Unifi doorbell will be quicker person detection and recognition rather than the Nest Hello into Frigate and then out to another tool and utilising Double Take to glue everything together. I’ve also noticed DeepStack has gone

hey did you find a way to implement it?

townsmcp commented 1 year ago

@kingunlim no. I installed the HomeBridge plugin however it’s performance was not great. It is a few seconds behind live performance. I have now added the G4 Instant to Scrypted which is instant performance. There is an MQTT plugin for Scrypted which I want to have a play with - I’m not 100% sure yet if it saves the jpeg as a blob or just the event. However as it stands right now, I have Scrypted rebroadcasting to Frigate which is amazing response (real-time). As I have a Coral M.2 installed in the laptop with Proxmox, inference dropped from 120ms to around 6ms. Today I installed Compreface and Double Take. It is all working very well together so far