Facial recognition & room presence using Double Take & Frigate

Wow this is a great project and has so many possibilities. I think you’re right in facial recognition being the best type of room presence. Custom actions per user, etc.

My question is, how do the others in your household feel about camera inside the house? Most people are used to motion sensors for alarms but a camera looks significantly different can feel a lot more intrusive.

Curious what you’ve done to overcome this? Do you disguise them or hide them? Do you find others in your household become accustomed?

I realize this isn’t within the scope of your project but having two cameras on each entry/exit from the room counting how many and who enters and exits would be next level for home automation and truly make a real time “smart home” possible.

Hey @mwolter thanks for the feedback. You bring up some great questions. My girlfriend wasn’t the biggest fan of the cameras inside the house at first, but I’ve slowly been working her over with various home automation projects. Her favorite is a simple motion sensor in the hallway that turns on the lights haha.

I have a few of my cameras placed where they are hard to see, but some are also more visible. None of them are in super private areas though, the one in my bedroom only looks at the stairs to see who is walking up them.

Ideally I’d have the cameras and other IoT devices on a different VLAN or something to lock them down a bit more or buy better cameras that only work locally. Currently I’m using Eufy and Wyze cameras inside my house. I’ve got two Nest cameras on the outside and unfortunately I can’t do anything cool with them yet. I really wish I could pipe my doorbell video feed into Frigate and Double Take.

1 Like

Thanks for the insight. This is definitely one of the hurdles to be navigated. My goal would be to use your project and have two cameras on each entrance to key rooms. Preferably they would be mounted high on the doorway, pointed downward to only video people entering and exiting. Then use that to keep track of room occupancy and trigger automations. Most likely node red will be integrated somehow. One hurdle to overcome will be running Ethernet to the cameras as I distain Wifi.

Thanks again and good luck with the project!

1 Like

Just published v0.6.0 which includes these additions.

  • UI: /config route to make live config changes
  • UI: /files route to view currently trained images
  • API: process Frigate snapshot MQTT messages (#18)
  • API: support for CompreFace plugins (#47)

Hi, may I ask a stupid question:-).

I read you github multiple times and see what you have done. But although it looks very promising and handy I do not know where to start with installation. Is that something you can give some guidance for?

Hey @sender, I can help you with any installation issues you have. Do you have Docker installed on your machine? If so, I’d go with a docker-compose.yml file and put this in it.

version: "3.7"

services:
  double-take:
    container_name: double-take
    image: jakowenko/double-take
    restart: unless-stopped
    volumes:
      - ${PWD}/config.yml:/double-take/config.yml
      - ${PWD}/.storage:/.storage
    ports:
      - 3000:3000

From here, create a config.yml file in the same directory and setup the configuration similar to this.

If you want to keep it basic and use the defaults you can do something like this. If you’re using a different detector then replace compreface with one of the other supported detectors.

mqtt:
  host: 192.168.1.1

home_assistant:
  url: http://192.168.1.1:8123
  token: xxx.xxx-xxx

frigate:
  url: http://192.168.1.1:5000

detectors:
  compreface:
    url: http://192.168.1.1:8000
    key: xxx-xxx-xxx-xxx-xxx

Once you’ve done that you should be able to go to localhost:3000 and view the UI.

Think I am stuck here:

@sender Did you get Docker installed?

Yes, docker is installed

Then you should be able to follow my post to get it running. I think before you had issues with docker compose.

Yes done that but how do I fire up that container via docker compose?

docker-compose up -d

But I would refer to Overview of Docker Compose | Docker Documentation

Soory, I need some help…

root@dockerhost ~/doubletake# ls
Dockerfile  app.py  docker-compose.yml  requirements.txt
root@dockerhost ~/doubletake# docker-compose up -d
-bash: /usr/local/bin/docker-compose: Permission denied
root@dockerhost ~/doubletake#

found this:
chmod +rwx /usr/local/bin/docker-compose

now downloading

got it running:

root@dockerhost ~/doubletake# docker ps
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                            NAMES
eeac25c13094        jakowenko/double-take    "docker-entrypoint.s…"   3 minutes ago       Up 3 minutes        0.0.0.0:3333->3000/tcp                           double-take
8c842eb889eb        portainer/portainer-ce   "/portainer"             10 days ago         Up 9 minutes        0.0.0.0:8000->8000/tcp, 0.0.0.0:9000->9000/tcp   portainer

next step: no reply on ip:3000 ?

Looks like you have it bound on port 3333 based off your previous message.

Yes! I must have copy pasted that…

Will proceed from here…

Wait for the next question :sweat_smile:

1 Like

Ok, here’s the first questions.

  1. I had filled my config via url/#/config, but then I decided to redeploy the container to port 3000 instead of 3333. Now I see in portainer my mqtt and homeassistant settings are still there (saved), but when going to the url/#/config it shows only # Double Take\n\n\n
    Where is my settingsfile gone?
  2. I have installed CompreFace on the same host (docker). I get the interface (before on 3333). But how do i get a face to compare against and where/what? Hope my question is clear…

@sender are you on Discord? Feel free to message me on there and I can help you out. My handle is Jako#0593

hi jako - i sent you an invite on disc as well - want to check up on something with you as well - it is working smoothly but i would like your short advice on the balance in settings / could use some guidance in that. Esp → resolution/# retries/settings… hope you wont mind :slight_smile:

1 Like

@Jako
Good day David, first thank you for producing and sharing this component. Makes managing deepstack much easier and reliable.

I’ve set it up and all works very well. Below automation via HA notifies matched and unmatched faces.

  - id: notify_person_double-take
    alias: Notify person double-take
    initial_state: true
    mode: single  
    trigger:
    - platform: mqtt
      topic: double-take/matches/#
    condition: []
    action:
    - choose:
      - conditions: '{{trigger.topic == "double-take/matches/unknown"}}'
        sequence:
        - service: notify.juan_gotify_frigate
          data:
            title: "{{trigger.payload_json['camera']|title}} camera"
            message: >
              {{trigger.payload_json['unknown']['name']}} detected
              ![Camera Image](http://192.168.1.100:3020/api/storage/matches/{{trigger.payload_json['unknown']['filename']}}?box=true)
      default:
      - service: notify.juan_gotify_frigate
        data:
          title: "{{trigger.payload_json['camera']|title}} camera"
          message: >
            {{trigger.payload_json['match']['name']|title}} detected with confidence {{trigger.payload_json['match']['confidence']}}%
            ![Camera Image](http://192.168.1.100:3020/api/storage/matches/{{trigger.payload_json['match']['filename']}}?box=true)

I have a ‘related’ question where you may be able to offer some guidance.

If you wanted Gotify to notify directly (skip HA) how would you approach it? I can make a scipt with curl commands and get the notification, but I was looking for double-take to push to gotify .

Moreover, how do you publish a jpg on https so it can be added to a notification whilst outside your lan?
I can proxy double-take via nginx, but it’s fully closed or fully open.

Appreciate this is beyond the intention of this thread, so any guidance is welcome.

Thank you

1 Like

Has anyone been able to get this working on Unraid? I’m having issues with the “volumes” section