Facial recognition & room presence using Double Take & Frigate

I have not set up Frigate yet
because i am waiting for the camera to support onvif
I am using camera blink and skybell
are not supported onvif

wills106, did you set Frigate with gpu acceleration on nano? Thanks in advance for your reply…

I’m not running Frigate on the Nano, just Double-Take and Deepstack

Thanks, same for me.

I pushed quite a few updates and small performance improvements last night. If you are using multiple detectors, then the same image is passed on each processing loop. This allows me to display a single image on the UI with the results per detector.

I’ve also added some more documentation on how I setup my Node-Red and Home Assistant notifications.

More notes on what’s included in this release can be found here.

1 Like

@thundergreen, I believe I’ve pinpointed Frigate crashing due to the snapshot.jpg request. If you set SNAPSHOT_RETRIES to 0, then it won’t request that image from Frigate.

Let me know if you try it out and what you think of the recent updates.

Will it then still work if no snapshot requested? Will try and report tha thanks so far

Yes, it will use the latest.jpg image for processing.

Will test now :slight_smile: will report later / tomorrow t be sure it won’t break again.

@Jako I guess i will have to pull latest image= is it already available?

Yes, latest and beta both have the same code. Just make sure to set SNAPSHOT_RETRIES to 0 in your docker-compose file.

done :slight_smile: waiting to crash … or not :slight_smile: Is there a way to autodelete the pics after a while? If I well understood i will have to mount a location into docker with my ics indise right? then i can chose them via GUI and train them?

like:

version: '3.7'

services:
  double-take:
    container_name: double-take
    image: jakowenko/double-take
    restart: unless-stopped
    volumes:
      - ${PWD}/.storage:/.storage
      - /usr/share/hassio/homeassistant/www/images/persons:/persons
    environment:
      DETECTORS: deepstack
      MQTT_HOST: 192.168.1.41
      MQTT_USERNAME: hass
      MQTT_PASSWORD: hass
      FRIGATE_URL: http://192.168.1.41:5000
      DEEPSTACK_URL: http://192.168.1.41:5030
      SNAPSHOT_RETRIES: 0
      SAVE_UNKNOWN: "true"
      PURGE_UNKNOWN: 12
    ports:
      - 3333:3000

PURGE_UNKNOWN and PURGE_MATCHES are the two variables responsible for deleting images after a certain time. They both default to 48 hours.

Yes, you can select the images from the GUI and train / delete them. You also have the ability to create new training folders from it as well.

:crossed_fingers: everything runs well for you.

For the moment it works perfectly! :slight_smile: Great work. On queston. I made a wrong training… means instead of naming the training with a face of a person like Thorsten … I took “person” . I would like to delete this training… is that possible?

image

Wanna delete it:

is that possible? Also is it possible to get this detected picture as an entity in home assistant ?

ARG! Just caught an error again:

2021-04-30T13:08:04Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '33648', 'HTTP_HOST': '192.168.1.41', (hidden keys: 24)} failed with OperationalError


Traceback (most recent call last):


  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 40, in __call__


    handler, values = adapter.match()


  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1945, in match


    raise NotFound()


werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.


During handling of the above exception, another exception occurred:


Traceback (most recent call last):


  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 999, in handle_one_response


    self.run_application()


  File "/usr/local/lib/python3.8/dist-packages/geventwebsocket/handler.py", line 87, in run_application


    return super(WebSocketHandler, self).run_application()


  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 945, in run_application


    self.result = self.application(self.environ, self.start_response)


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in __call__


    return self.wsgi_app(environ, start_response)


  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 48, in __call__


    return self.wsgi_app(environ, start_response)


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app


    response = self.handle_exception(e)


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception


    reraise(exc_type, exc_value, tb)


  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise


    raise value


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app


    response = self.full_dispatch_request()


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request


    rv = self.handle_user_exception(e)


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception


    reraise(exc_type, exc_value, tb)


  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise


    raise value


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1948, in full_dispatch_request


    rv = self.preprocess_request()


  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request


    rv = func()


  File "/opt/frigate/frigate/http.py", line 89, in _db_connect


    database.connect()


  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect


    raise OperationalError('Connection already opened.')


peewee.OperationalError: Connection already opened.


2021-04-30T13:08:09Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '33688', 'HTTP_HOST': '192.168.1.41', (hidden keys: 24)} failed with OperationalError

@thundergreen, is Frigate still running for you? I get errors from time to time in Frigate, but it hasn’t crashed in days for me. I typically use the Frigate UI to test if it’s still up. In the past it wouldn’t even load when it crashed.

There isn’t a way to untrain the detectors from the UI yet, but you can do it from the API outlined here.

I have a picture card in HA and got it working by setting up a HA entity that updates when I’m found by the detectors. I have most of this documented here.

Then I setup a generic camera in HA that looks like this.

- platform: generic
    still_image_url: http://localhost:3000/api/storage/matches/{{states.sensor.nodered_af683793_e48ea8.attributes.filename}}?box=true
    name: David

next time it crashes i will test if UI still responsive. Will try your camera stuff … thanks alos to add my nodered flows / examples to the wiki :slight_smile:

1 Like

When running the curl command i get [{“detector”:“deepstack”,“results”:{“success”:true,“duration”:0}}] but person not deleted in gui

That just untrains the detector right now. You would need to manually delete the folder from your mounted storage. I’ll work on adding a way to do that more easily in a future update.

great then i will remove the folder manually :slight_smile:

Frigate still crashes with option snapshots retries 0 :frowning:

Weird. Hasn’t crashed for me since I stopped using the snapshot photos. Is Frigate’s UI unresponsive too?