blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.24k stars 1.66k forks source link

[Support]: Doubletake not receiving correct frames #6729

Closed denveronly closed 1 year ago

denveronly commented 1 year ago

Describe the problem you are having

im running frigate in a docker container on Unraid. Runing DoubleTake + Compreface connected to Frigate for Face detection Im trying to implement entrance door open on face detection. And the thing im struggling to achieve is normal operation. Well it works, sometimes i can say and 2 problems i encounter

1) So i come to the door, Frigate catches me, i stand close to the camera and look at it (Frigate events list says IN PROGRESS) and i can stand 10-20 seconds. I turn and go from the camera vision, BANG -door open. I guess Frigate got the video processed and snapshot sent to mqtt=>deepstack+compre=door switch

1) Ive set a zone in my config for Door camera zone_1, set a zone in Deepstack config to throw back walking people far from door. I come to the door, do the same thing with hiding from camera vision. A man in far away stands in this time. Frigate is IN PROGRESS until that man walks away.

So the thing is long processing from Person frame catch to MQTT send, And Zone for Deepstack.

Version

latest

Frigate config file

mqtt:
  host: 192.168.1.101
  port: 1883
  # Optional: topic prefix (default: shown below)
  # NOTE: must be unique if you are running multiple instances
  topic_prefix: frigate
  # Optional: client id (default: shown below)
  # NOTE: must be unique if you are running multiple instances
  client_id: mqtt
  # Optional: user
  user: mqtt
  password: mqtt

go2rtc:
  streams:
    dahuatop:
      - rtsp://lmonitor?channel=1&subtype=0
    dahuatop_sub:
      - rtsp://cam/realmonitor?channel=1&subtype=1
    door:
      - rtsp://realmonitor?channel=1&subtype=0
    door_sub:
      - rtsp:///realmonitor?channel=1&subtype=1
    palubagarage:
      - rtsp:///Streaming/channels/1302
    ellinggarage:
      - rtsp://
    palubawater:
      - rtsp://h264Preview_01_main
    palubawater_sub:
      - rtsp:///h264Preview_01_sub

detectors:
  coral:
    type: edgetpu
    device: usb

birdseye: 
  enabled: true
  width: 1280
  height: 720
  quality: 8
  mode: objects
  restream: True

objects:
  filters:
    person:
      min_score: 0.76
      # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
      threshold: 0.77
      min_area: 4000 
    car: 
      min_score: 0.75
  track:
    - person
    - car

# snapshots:
#   enabled: true
#   retain:
#     # Required: Default retention days (default: shown below)
#     default: 14
#     # Optional: Per object retention days
#     objects:
#       person: 14

cameras:

### CAMERA ENTRANCE DOOR

  Door:
    ffmpeg:
      inputs:
        - path: rtsp://
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://
          input_args: preset-rtsp-restream
          roles:
            - record
    detect:
      width: 1280
      height: 720
      fps: 15
    objects:
      track:
        - person
      filters:
        person:
          min_score: 0.6
          # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.7
          min_area: 2000

    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain: 
        default: 2
      required_zones:
        - near

    record:
      enabled: True
      events:
        retain:
          default: 7
    mqtt:
      timestamp: False
      bounding_box: False
      crop: True
      height: 1200
    zones:
      near:
        coordinates: 1101,720,769,310,38,241,0,720

Relevant log output

no

FFprobe output from your camera

no

Frigate stats

No response

Operating system

UNRAID

Install method

Docker CLI

Coral version

USB

Network connection

Wired

Camera make and model

Amcrest

Any other information that may be helpful

No response

DOUBLE TAKE CONFIG

# Double Take
# Learn more at https://github.com/jakowenko/double-take/#configuration
mqtt: 
  host: 192.168.1.101
  username: mqtt
  password: mqtt
home_assistant:
  url: http://192.168.1.101:8123
  token:  token
#
frigate:
  url: http://192.168.1.99:5999

  update_sub_labels: true
  cameras:
    - Door
  zones:
    - camera: Door
      zone: zone_1
  attempts:
    # number of times double take will request a frigate latest.jpg for facial recognition
    latest: 1
    # number of times double take will request a frigate snapshot.jpg for facial recognition
    snapshot: 1
    # process frigate images from frigate/+/person/snapshot topics
    mqtt: true
    # add a delay expressed in seconds between each detection loop
    delay: 0

  image:
    # height of frigate image passed for facial recognition
    height: 500

detectors:
#  deepstack:
#   url: http://192.168.1.99:5000
#    key:
#    timeout: 30

  compreface:
    url: http://192.168.1.101:8000
    key: key
#    # recognition api key
 #   key: key
#    # number of seconds before the request times out and is aborted
    timeout: 10
#    # minimum required confidence that a recognized face is actually a face
    # value is between 0.0 and 1.0
    det_prob_threshold: 0.7
    # require opencv to find a face before processing with detector
    opencv_face_required: false

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: 60
    # hours to keep match images until they are deleted
    purge: 168
    # minimum area in pixels to consider a result a match
    min_area: 16000

  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: 40
    # hours to keep unknown images until they are deleted
    purge: 24
    # minimum area in pixels to keep an unknown result
    min_area: 0
NickM-27 commented 1 year ago

You are saying deepstack but I think you mean doubletake? If so we would need to see doubletake config, this sounds like a configuration error to me

denveronly commented 1 year ago

yes man, its doubletake+compreface

NickM-27 commented 1 year ago

I see you have a zone for Door named near but in the Doubletake config you are referring to zone_1 which does not exist anywhere

denveronly commented 1 year ago

I see you have a zone for Door named near but in the Doubletake config you are referring to zone_1 which does not exist anywhere

Yeah, it was my bad, i tried changing zone names. I made a zone change it got a lot better. Not so instant as i would love it to be.

Now the thing is that there is a delay when im walking from far, it catches my face with a 50x60px (which is set in doubletake as unknown for less false alarms min_area: 16000 ) and there is a slight delay when frigate sends second snapshot when im close in NEAR zone up to 10seconds

Is there any way i can tweak snapshot send time in frigate? like every 3-5 seconds with a person catched

NickM-27 commented 1 year ago

You have set your attempts to 1 meaning doubletake will only attempt to get 1 picture for each of those methods. You of course would want this value to be higher to it attempts to get many different pictures

denveronly commented 1 year ago

Oh, thats what it does Okay ill try it Thank you, ill report

DaCeige commented 1 year ago

Try these settings.

Note the delay is exactly what you're asking for. Take a pic, look for your face, wait 1.25 seconds, take another pic, look for your face, wait 1.25 seconds... found you... stop looking anymore. Should give you about 30 seconds or less of detection time. Changing snapshot to 0 will give you more predictable size results and whole frame results. I find the snapshots are great, but less useful until you have it better trained with the latest images.
Also disable mqtt to get rid of all the snapshots.

  attempts:
    # number of times double take will request a frigate latest.jpg for facial recognition
    latest: 22
    # number of times double take will request a frigate snapshot.jpg for facial recognition
    snapshot: 0
    # process frigate images from frigate/+/person/snapshot topics
    mqtt: false
    # add a delay expressed in seconds between each detection loop
    delay: 1.25
denveronly commented 1 year ago

Execellet work Thank you ill give a try!

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.