Facial recognition & room presence using Double Take & Frigate

I installed compreface on my old windows laptop using docker for windows. I just downloaded the compose.yml from the compreface GitHub and ran docker-compose up -d using powershell.exe in the folder I downloaded the compose.yml too. This might work for you?

Hello I have a question,

On the one hand regarding Deepstack:
I have installed the addon and it runs on my Home Assistant instance. However, I always get a timeout timeout of 15000ms exceeded on Double Take (same HA instance) I have already tried everything:

http, ip direct, internal docker ip, changed port, restarted, timeout to 30.

but unfortunately it doesn’t seem to be able to connect.
Double Take can connect to frigate (also the same HA instance) without any problems.

my config looks like this:

detectors:
  deepstack:
    url: http://192.168.1.2:50001
    timeout: 30

When I open the Deepstack server itself I get the message that Deepstack is running. Also I see in the Deepstack log that Double Take tries to process the images.

Log
DeepStack: Version 2021.09.01
/v1/vision/face
---------------------------------------
/v1/vision/face/recognize
---------------------------------------
/v1/vision/face/register
---------------------------------------
/v1/vision/face/match
---------------------------------------
/v1/vision/face/list
---------------------------------------
/v1/vision/face/delete
---------------------------------------
/v1/vision/detection
---------------------------------------
---------------------------------------
v1/backup
---------------------------------------
v1/restore
[GIN] 2021/11/03 - 12:55:58 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/03 - 12:56:24 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"

What could be the reason for this?

Many thanks

i found out.

My Docker instance is virtualized on my Proxmox host, so it is mandatory to set the CPU type “Host”.

Now everything works.

2 Likes

Thank you for this add-ons!

It’s possible to add a compatibility with custom_model like this documentation ?
Custom Models: Samples | DeepStack 2021.09.1 documentation
GitHub - odd86/deepstack_licenceplate_model: Deepstack Licence Plate Model

I know double-face is not intended for logo or license plate recognition, but looking at the config via label, I feel like this is an environment value to add on the deepstack side to be used.

This new env var named MODELSTORE-DETECTION with a bind folder where we can add new models *.pt. I think it is possible to make a bind like the other addons.
On frigate for example, env is like this in config.json:

"environment": {
    "CONFIG_FILE": "/config/frigate.yml"
}

so maybe a new var with a new folder like this

"MODELSTORE-DETECTION": "/config/models"

can be work… I don’t know if this will be helpful for you, I’m a beginner at this kind of stuff…

I spent hours trying to find out why there was no documentation on this addon and the custom_models before I came across this thread, and I understand why now, the addon is very young.

If this needs more dev, or is too complicated to implement, I would have at least proposed the idea :slight_smile:

Can you elaborate where you set the cpu type to “host”. I’m getting the same errors using proxmox. Thanks.

Was able to find it, but for anyone else having the issue to adjust the CPU host in proxmox: Nested virtualization with Proxmox | It's full of stars!

Thanks for posting the issue, i would have never found it on my own.

1 Like

sure is located here:

2 Likes

Thanks for making this and for the HA add-ons for double-take and deepstack. Up and running in 10 minutes today!!

Nit picky but any chance of changing the icon to something other than cctv as that is the same icon Frigate uses so creates a bit of confusion in the sidebar?

Maybe camera-account or camera-iris?

image

I wish the sensors created by double take for a specific person would delete/switch their values after so long of said person not being detected by a camera. Ex: when I am detected by a camera my sensor will update with the state of the camera I was detected by, but after X amount of minutes it will switch the state to unknown or undetected. Making it easier to write automations using a single camera would be a wonderful tool.

Hi,
I tried to install double take and deepstack from @Jako 's repository. Installation went smoothly but deepstack always give me error 500 on every query in its log and double take (and home assistant on service calls) gives me a timeout. I’m on HAOS so no proxmox here.

I didn’t find any useful bit of log inside the deepstack container, so if you can tell me where to look, I’m glad to debug.

Home Assistant :
2021-11-12 13:49:27 ERROR (SyncWorker_11) [custom_components.deepstack_face.image_processing] Depstack error : Timeout connecting to Deepstack, the current timeout is 5 seconds, try increasing this value

Deepstack :
[GIN] 2021/11/12 - 13:50:22 | 500 | 1m0s | xxx.xxx.xxx.xxx | POST "/v1/vision/face/recognize"

If you want to open a feature request on Github, I can look into adding that feature.

The camera specific entities should reset back to 0 people after 30 seconds, but the person entities retain the value until the state changes.

Glad you found us on Discord, we’ll get you some help!

EDIT: I have solved this for now after reading in discord that there are problems with timeout issues in latest deepstack build.
I installed deepstack beta cpu X5 in container and now its working :smile:
END OF EDIT:

Hi, no matter what i do i cannot get deepstack to connect to Double take.
Ive tried running deepstack in a Container on NAS which works for HA using HACS deepstack Intergration.
I have installed your addon and see the Deepstack Page when i go to the url, but Double Take will not connect. Im running on a VM on a NAS drive

# Double Take
mqtt:
  host: 192.168.1.8:1883
  username: ****
  password: ****
    
frigate:
  url: http://192.168.1.8:5000

detectors:
  deepstack:
    url: http://192.168.1.8:50001
    timeout: 30
DeepStack: Version 2021.09.01
/v1/vision/face
---------------------------------------
/v1/vision/face/recognize
---------------------------------------
/v1/vision/face/register
---------------------------------------
/v1/vision/face/match
---------------------------------------
/v1/vision/face/list
---------------------------------------
/v1/vision/face/delete
---------------------------------------
/v1/vision/detection
---------------------------------------
---------------------------------------
v1/backup
---------------------------------------
v1/restore
[GIN] 2021/11/12 - 19:20:30 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:21:00 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:21:35 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:24:59 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:27:15 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:27:28 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:27:58 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:32:40 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:33:10 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:33:41 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
[GIN] 2021/11/12 - 19:34:11 | 500 |          1m0s |     172.30.32.1 | POST     "/v1/vision/face/recognize"
1 Like

same problem for me

Same problem, If I use deepstack cpu x5 beta alone it works regularly, if I try to use it with Double take it stays red (error timeout)

Hey @xbmcnut, I updated the icon like you suggested and ended up going with mdi:face-recognition. Reload add-ons, then uninstall and reinstall (or rebuild) the current add-on and you should see the new icon.

Screen Shot 2021-11-15 at 12.08.22 PM

3 Likes

same for me

I think it is better to wait for the Compreface addon:

1 Like

That’s awesome, thank you. Great that there was already a facial recognition icon!

I’m looking for suggestions on how(if possible) create an automation using both Frigate and Double Take. End goal of the automation would be to pop up a video of the camera on the dashboard when a person is detected. Which is the easy part and one I’ve already got setup. However as always there is always a catch.

I would like to alert upon person detection if any of the following conditions are met - 1. There is no match from Double Take or 2. Double Take returns and unknown match.

Alerting on an unknown match is doable, however if a face is not found Double Take doesn’t return a result. This is reproducible if you cover your whole face and trigger a person match.

The reason I want to alert on unknown and not face detections is because I want to prevent it from alerting on myself or family members. So only on people not belonging to the household.

Does Double Take return a result, message, or similar when it receives a person message to match and is unable to decipher it?

Has anybody experimented with the compreface custom builds for gpu?

I finally got the 5 containers going on Unraid but I’m curious about what kind of performance gains and accuracy I could get by passing my secondary GPU to the core container.

As of now it doesn’t seem to murder my CPU like frigate would without a TPU so I feel like the default build may be the way to go.

@Jako amazing program. This really takes home automation to the next level.

Have you or anybody thought of ways you could announce (tts or ios) when a person or a group of matched persons are in an area like the front door.

Right now you can track the movement of a person pretty easy (mqtt/DT/matches + HA mqtt entities), but say if your mother in law shows up with her sister at your front door and you’ve pre-trained the model. How do you manage by camera and how do you manage when a group of known people are at a camera. Is there a way to hold that in memory somewhere (HA) or some nodered logic such that you can pull that information when a condition is triggered and send a warning with a list of people?

Maybe something like this in MQTT?
image