skrashevich/double-take

[BUG] update_sub_labels: true doesn't work

Opened this issue · 53 comments

Hello i'm on the latest version of double take and latest version of frigate ( tried on the latest frigate beta and it's the same)

I didn't change my config and update sub labels doesn't work anymore :(

Any idea why ?

Having the same issue

Show your configuration file

i already check if i have " stop_on_match: true" on true because if it's false that doesn't work but it's already on true :(

I have reproduce this error in my environment. I'll try to fix it soon

Thanks for your time :)

fixed in v1.13.11.8 (I hope; tested within frigate 0.13)

Yeah i confirm that working again ! Thanks again for your time

I've installed v1.13.11.8 but still have the same issue, no sub_labels being written. I've looked in the HA, Double_Take and frigate logs but cannot see anything obvious.

v1.13.11.8 did not fix it for me. Even tried the config above.

What version of frigate?

Frigate 0.13.0-beta6 with DT v1.13.11.8. Tried Frigate 0.12.1 but same issue. No errorlogs. I tired curl --header "Content-Type: application/json" -X POST http://192.168.1.10:5000/api/events/1700682681.35xxxxx-ndw2bl/sub_label -d '{"subLabel": "Test-name"}' this updates sub_label in frigate for the specific event.

do you have /.storage/latest directory?

I'm running Frigate 0.12.1 on a barebone system running HAOS with both Frigate and Double Take installed as addons. I can confirm I do not have the /.storage/latest directory.

create this directory and set permissions same as /.storage/matches
Then restart double-take and check

Ok I might be misunderstanding something; I don't have a /.storage/matches folder either.

What I do have under /media/double-take are subfolders 'latest' and 'matches' so:

/media/double-take/latest
/media/double-take/matches

I also have

/media/double-take/matches/train

All these folders have content in them such as the latest images from each of my cameras and the folder location is configured through the 'MEDIA_PATH' configuration in the add-on.

Ok I might be misunderstanding something; I don't have a /.storage/matches folder either.

What I do have under /media/double-take are subfolders 'latest' and 'matches' so:

/media/double-take/latest
/media/double-take/matches

I also have

/media/double-take/matches/train

All these folders have content in them such as the latest images from each of my cameras and the folder location seems to be configured through the 'MEDIA_PATH' configuration in the add-on.

Ok I might be misunderstanding something; I don't have a /.storage/matches folder either.

What I do have under /media/double-take are subfolders 'latest' and 'matches' so:

/media/double-take/latest /media/double-take/matches

I also have

/media/double-take/matches/train

All these folders have content in them such as the latest images from each of my cameras and the folder location seems to be configured through the 'MEDIA_PATH' configuration in the add-on.

Same setup as mine. Intel nuc running hassos with double-take, aiserver and frigate as addons. I will try to change the storage and media folder after work.

Had no luck in changing the storage folders.
Folders is as below in hassos:
/media/double-take/latest
/media/double-take/matches

edit: everything works now, reinstalled DT.

I have checked my instances and it appears that sublabels are updated if recognition match came from either latest or snapshot, however no update if the match was on mqtt picture (frigate 0.12)

Also noticed that snapshots, despite showing cropped in frigate, get passed to DoubleTake as a full frame with no crop usually, very rarely with crop, even though cropping is set in frigate

All I ever get is person. It used to update based on double take if it absolutely knew who it was.

Speaking of which, I'm getting a lot of false positives. Patches of grass coming up as me or one of my family. I know it has no control as to what Frigate sends it but I have it prettty fine tuned. I didn't know if there was anyway to get a bit more specific or to how to train it for unknown people. It seems like now it just keeps trying until it find the closest face and labels it such. How do we get unknowns to show up properly?

All I ever get is person. It used to update based on double take if it absolutely knew who it was.

Speaking of which, I'm getting a lot of false positives. Patches of grass coming up as me or one of my family. I know it has no control as to what Frigate sends it but I have it prettty fine tuned. I didn't know if there was anyway to get a bit more specific or to how to train it for unknown people. It seems like now it just keeps trying until it find the closest face and labels it such. How do we get unknowns to show up properly?

Set up confidence for unknown the same as for a match and observe. I've got match confidence 98, unknown 98 as well as no false positives.

All I ever get is person. It used to update based on double take if it absolutely knew who it was.

Speaking of which, I'm getting a lot of false positives. Patches of grass coming up as me or one of my family. I know it has no control as to what Frigate sends it but I have it prettty fine tuned. I didn't know if there was anyway to get a bit more specific or to how to train it for unknown people. It seems like now it just keeps trying until it find the closest face and labels it such. How do we get unknowns to show up properly?

Set up confidence for unknown the same as for a match and observe. I've got match confidence 98, unknown 98 as well as no false positives.

Would you mind sharing your settings please? I'm wondering if there is something I missed or forgot to add. Thanks!

Here it is

# Double Take
# Learn more at https://github.com/jakowenko/double-take/#configuration
mqtt:
  host: 192.168.1.10
  username: frigate
  password: ***********
  client_id: double-take
  topics:
    # mqtt topic for frigate message subscription
    frigate: frigate/events
    #  mqtt topic for home assistant discovery subscription
    homeassistant: homeassistant
    # mqtt topic where matches are published by name
    matches: double-take/matches
    # mqtt topic where matches are published by camera name
    cameras: double-take/cameras
    
frigate:
  url: http://192.168.1.10:5000
  update_sub_labels: true
  stop_on_match: true
  min_area: 0
  labels:
    - person
  #zones:
    #- camera: doorcam
      #zone: entrance
  attempts:
    # number of times double take will request a frigate latest.jpg for facial recognition
    latest: 10
    # number of times double take will request a frigate snapshot.jpg for facial recognition
    snapshot: 10
    # process frigate images from frigate/+/person/snapshot topics
    mqtt: true
    # add a delay expressed in seconds between each detection loop
    delay: 0
    image:
      height: 1080
  cameras:
    - doorcam
    
cameras:
  doorcam:
    mqtt:
      timestamp: False
      bounding_box: False
      crop: false
      quality: 80
      height: 1080
      
  
      
detectors:
  compreface:
    url: http://192.168.1.10:8000
    # recognition api key
    key: *********
    # number of seconds before the request times out and is aborted
    timeout: 15
    # minimum required confidence that a recognized face is actually a face
    # value is between 0.0 and 1.0
    det_prob_threshold: 0.8
    # require opencv to find a face before processing with detector
    opencv_face_required: false
    # comma-separated slugs of face plugins
    # https://github.com/exadel-inc/CompreFace/blob/master/docs/Face-services-and-plugins.md)
    # face_plugins: mask,gender,age
    # only process images from specific cameras, if omitted then all cameras will be processed
    # cameras:
    #   - front-door
    #   - garage
detect:
  match:
    # save match images
    save: true
    # include base64 encoded string in api results and mqtt messages
    # options: true, false, box
    base64: false
    # minimum confidence needed to consider a result a match
    confidence: 98
    # hours to keep match images until they are deleted
    purge: 168
    # minimum area in pixels to consider a result a match
    min_area: 3600

  unknown:
    # save unknown images
    save: true
    # include base64 encoded string in api results and mqtt messages
    # options: true, false, box
    base64: false
    # minimum confidence needed before classifying a name as unknown
    confidence: 98
    # hours to keep unknown images until they are deleted
    purge: 128
    # minimum area in pixels to keep an unknown result
    min_area: 3600

Here it is

# Double Take

# Learn more at https://github.com/jakowenko/double-take/#configuration

mqtt:

  host: 192.168.1.10

  username: frigate

  password: ***********

  client_id: double-take

  topics:

    # mqtt topic for frigate message subscription

    frigate: frigate/events

    #  mqtt topic for home assistant discovery subscription

    homeassistant: homeassistant

    # mqtt topic where matches are published by name

    matches: double-take/matches

    # mqtt topic where matches are published by camera name

    cameras: double-take/cameras

    

frigate:

  url: http://192.168.1.10:5000

  update_sub_labels: true

  stop_on_match: true

  min_area: 0

  labels:

    - person

  #zones:

    #- camera: doorcam

      #zone: entrance

  attempts:

    # number of times double take will request a frigate latest.jpg for facial recognition

    latest: 10

    # number of times double take will request a frigate snapshot.jpg for facial recognition

    snapshot: 10

    # process frigate images from frigate/+/person/snapshot topics

    mqtt: true

    # add a delay expressed in seconds between each detection loop

    delay: 0

    image:

      height: 1080

  cameras:

    - doorcam

    

cameras:

  doorcam:

    mqtt:

      timestamp: False

      bounding_box: False

      crop: false

      quality: 80

      height: 1080

      

  

      

detectors:

  compreface:

    url: http://192.168.1.10:8000

    # recognition api key

    key: *********

    # number of seconds before the request times out and is aborted

    timeout: 15

    # minimum required confidence that a recognized face is actually a face

    # value is between 0.0 and 1.0

    det_prob_threshold: 0.8

    # require opencv to find a face before processing with detector

    opencv_face_required: false

    # comma-separated slugs of face plugins

    # https://github.com/exadel-inc/CompreFace/blob/master/docs/Face-services-and-plugins.md)

    # face_plugins: mask,gender,age

    # only process images from specific cameras, if omitted then all cameras will be processed

    # cameras:

    #   - front-door

    #   - garage

detect:

  match:

    # save match images

    save: true

    # include base64 encoded string in api results and mqtt messages

    # options: true, false, box

    base64: false

    # minimum confidence needed to consider a result a match

    confidence: 98

    # hours to keep match images until they are deleted

    purge: 168

    # minimum area in pixels to consider a result a match

    min_area: 3600



  unknown:

    # save unknown images

    save: true

    # include base64 encoded string in api results and mqtt messages

    # options: true, false, box

    base64: false

    # minimum confidence needed before classifying a name as unknown

    confidence: 98

    # hours to keep unknown images until they are deleted

    purge: 128

    # minimum area in pixels to keep an unknown result

    min_area: 3600

Accualy I think I have more settings set than you do. I would highly suggest taking advantage of the CompreFace plugins for age and sex and such. It seemed to help with the issue as well. The really only main thing different was that I had my unknown threshold at 40. I switch it to 98 the same as the match and we'll see if that's any better.

On and for the developer. I originally has .7 installed and it said in the main add on page that it was at .8. But every time I restarted the server it would say .7. I ended up uninstalling and reinstalling and that brought it up but there was really no warning or anything. Just thought you should know.

Strange, in addons it showed version x.8 but logs showed x.7. Reinstalled and sub labels works.

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

This issue was closed because it has been stalled for 5 days with no activity.

Still the issue exists

Sub labels were working on v1.13.11.8 for me, but images via MQTT wern't. Updating to v1.13.11.9rc2 fixed images coming via mqtt, but not sub labels aren't working. I'm not seeing anything in logs either to help out

I'm fairly sure that mqtt detections can't update sublables, so I think this isn't possible or a bug (for me). Sub labels update fine for detections from snapshots.

@Mikescotland FYI in your config for double take you have the following:

cameras:

  doorcam:

    mqtt:

      timestamp: False

      bounding_box: False

      crop: false

      quality: 80

      height: 1080

I'm fairly sure those are frigate settings, not double take settings so you can remove those.

I'm going to turn off snaps and latest and check if that gets updated only with mqtt.
Will let you know once I'm back at home and can present my ugly mug to the camera.

@Mikescotland FYI in your config for double take you have the following:

cameras:

  doorcam:

    mqtt:

      timestamp: False

      bounding_box: False

      crop: false

      quality: 80

      height: 1080

I'm fairly sure those are frigate settings, not double take settings so you can remove those.

You're right. I hashed them out for now and see if this works (I basically had same entries here and in the frigate config). Thanks for pointing it out.

You're absolutely right. Mqtt does not update the sublabel!

You're absolutely right. Mqtt does not update the sublabel!

can you provide steps-to-reproduce ?

Fyi I don't think you can add a sub label via a mqtt snapshot as there is no event id.

Fyi I don't think you can add a sub label via a mqtt snapshot as there is no event id.

make sense :) I'm really forgot about it

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

I'm also having a hard time getting sup_labels to update. I did a manual POST to my frigate container from my double-take container using CURL and it worked perfect. Frigate now has the sub label drop down and I see the label on the event I tested with. So I know my double-take container can reach my frigate container. double-take is also properly recognizing faces, it just doesn't seem to do the POST back to Frigate to update the label. If I look at the nginx logs in Frigate I can see my manual POST with CURL but I don't see any other POSTs coming from double-take. I've looked over my setup over and over and read everything in this thread and the docs several times. I just don't see what I am doing wrong. I'm currently testing with double-take:latest (v1.13.11.8) and frigate:stable (0.13.2-6476F8A).

I finally got a single label update. I see what is going on now. In double-take I see it's detected the names of people properly but for some reason only one has been flagged as a "match" so far. How is it properly detecting names but not considering them a match? The confidence will be 100% and the name is correct but still not a match?

I finally got a single label update. I see what is going on now. In double-take I see it's detected the names of people properly but for some reason only one has been flagged as a "match" so far. How is it properly detecting names but not considering them a match? The confidence will be 100% and the name is correct but still not a match?

What are your doubletake config values for match?
What is the % on the pictures having names on them?
If you set 90% in your config, anything above this would be considered a match. If the confidence is below 90%, it will show the name but won't be a match.

Matched and above confidence set in the config with be green.
Matched but below confidence set in the config will be red.
Mine is set to 91% confidence. See attached examples.
Screenshot_20240220_195139
Screenshot_20240220_195152

Matched and above confidence set in the config with be green. Matched but below confidence set in the config will be red. Mine is set to 91% confidence.

Yep, I figured this out right after posting. It was the box size that was keeping it from being a match. I when through a few days of results and think I have some better thresholds set now.

Thanks for the response.

I've been unable to get sublabels to work for months now. Interestingly I just installed 1.13.11.9rc2, didn't change anything in the config and bang, it's working again. Very strange but happy to have this functionality back :)

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

I've moved over to this branch but using the latest stable frigate, I see the match labels come back to frigate.

Matched and above confidence set in the config with be green. Matched but below confidence set in the config will be red. Mine is set to 91% confidence. See attached examples. Screenshot_20240220_195139 Screenshot_20240220_195152

This did the trick for me..
Thx

I am having the same issue via frigate, my snapshots and latest are uncropped, coming in with about 60x60px size for the face. My MQTT images are coming in cropped and give about 110x110 size for the face. The is the case eventhough I have set snapshots to crop: true in Frigate config.

The MQTT images are correctly classified by Compreface, since my min area is 10,000, but they do not update the sub labels in frigate. If i set the min area lower, the snapshot and latest images are then classified, and the sub label updates start to work.

Can we either figure out how to crop the snapshots in frigate, or get the MQTT photos to update the sub labels?

I tried the beta too, and the same issue persists.

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.