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.25k stars 99 forks source link

Few questions #258

Open atv2016 opened 2 years ago

atv2016 commented 2 years ago

Hi @jakowenko

Few questions if you would:

1. I don't see the update_sub_labels take effect in frigate. I have set it to false and to true, but no change. Is there anything else i need to set ?

Do i need to set object labels for it to start?

In your example code below

frigate settings (default: shown below)

if double take should send matches back to frigate as a sub label NOTE: requires frigate 0.11.0+ update_sub_labels: false

2. Is this the total value of the box 20x20 ?3. How do i calculate min_area ?

ignore detected areas so small that face recognition would be difficult quadrupling the min_area of the detector is a good start does not apply to MQTT events min_area: 0

3. Do i need below for sub labels to show ? object labels that are allowed for facial recognition labels:

4. I'm not sure what is the difference between a latest.jpg, a snapshot.jpg, or what mqtt: true does/means 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

5. Do i need to pass the height of my frigate cameras here ? I have a mix of sub streams and 1080P, so what do i enter here? image: height of frigate image passed for facial recognition height: 500

I'm using DeepStack btw, as i can't use compreface on my celeron. And although its great the add ons are in homeassistant, i feel running either really drags down my HA installation. Now that i'm running DeepStack on a separate server next to frigate, it works much better.

Many thanks,

NickM-27 commented 2 years ago
  1. Set update_sub_labels to true and that is all it takes for frigate to set the names once a face is matched as a positive match.
  2. Yes, it is in pixels. Doubletake shows the dimensions of the face in the detections page.
  3. No, leave it blank as person is the default value anyway
  4. latest is the full res, full view image from frigate. snapshot is the cropped image of just the object from frigate. mqtt: true tells doubletake to also run face recognition on the mqtt snapshots (similar to other snapshots).
  5. yes, you should pass the height so doubletake does not resize the image. You should use the events part to set the height per camera
frigate:

  url: ...
  update_sub_labels: true

  events:

    backyard_cam:
      image:
        height: 960

    front_doorbell_cam:
      image:
        height: 960

    garage_cam:
      image:
        height: 1080

    office_cam:
      image:
        height: 1080
atv2016 commented 2 years ago

Amazing! Thank you.

  1. Hmm not seeing anything appear in frigate yet. Is it going to add it to the events stream ?
  2. Why would anyone want to run face detection on mqtt snapshots as well ? Is there a benefit one over the other?
  3. And what happens if double take resizes (and why does it do that, frigate already has the right sizes set?). What is the default double take uses? Should i pass the same height (height or width?) i configured in frigate.yml under cameras?
NickM-27 commented 2 years ago
  1. You can see how it looks here https://github.com/blakeblackshear/frigate/pull/2949#issuecomment-1068339913
  2. More chances of finding a face. I personally don't use it.
  3. Because if your image is too small then you might want to enlarge it. Yes, you should set it as the same height you have set in frigate config.
atv2016 commented 2 years ago

Thanks Nicholas. So what about when you upload pictures, those pics are specified in size. Does it matter if i double take doesn't know there what size it is in advance?

As for as 1, i have specified all the sizes now (had to look for CIF PAL, different resolutions) and i will retrain everything. Let's see if that makes a difference. Is there an easy way to check the frigate version, i thought i had the latest but now i'm not sure. I'm pulling this image in docker: blakeblackshear/frigate:stable-amd64

NickM-27 commented 2 years ago

blakeblackshear/frigate:stable-amd64

No, that is an old version, you need to use blakeblackshear/frigate:stable to get 0.11 (which is when this feature was added)

atv2016 commented 2 years ago

Argh - thanks Nicholas, appreciate your help greatly.

Vendo232 commented 2 years ago

2. More chances of finding a face. I personally don't use it.

Hello @NickM-27 , would you be able to share your Double Take config?

Also do you have one of your camera using 2 streams ( Low for detection and High for recording? ) How would you set it up to increase pixel area for the face?

I have driway cam in low res ( 360x640 ) and high res in 2160x3840

Vendo232 commented 2 years ago

I have modified Frigate Config.yaml image

then in doubletake added this section, I`m using height of the recorded video ( high res ) image

will see if it helps improve / increase the double Take BOX pixels

Also I`m using Compreface as the detector. Deepstack produced much worse result than Compreface.

Vendo232 commented 2 years ago

it seems it helped increase box resolution and as such increase detection accuracy. image

also In frigate config I have increased height up to 1000 from 500 and eliminated Latest and Snapshots to run on MQTT only