blakeblackshear / frigate

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

[Config Support]: Repeated stationary object detection due to trees #7385

Closed jpettitt closed 1 year ago

jpettitt commented 1 year ago

Describe the problem you are having

I'm seeing objects repeatedly re-detected and I suspect it's because there is a tree adjacent to or in some cases in front of the object and when the wind moves the tree the motion triggers a detection. Any ideas on how to mitigate this?

image

Version

0.12.1-367D724

Frigate config file

database:
  path: /frigatedb/frigate.db

mqtt:
  enabled: true
  user: "mqtt"
  password: "{FRIGATE_MQTT_PASSWORD}"
  host: 192.168.xxx.xxx

go2rtc:
  api:
    listen: "0.0.0.0:1984" 
  streams:
    garage:
      - rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@192.168.xxx.xxx:554/h265Preview_01_main
    garage-sub:
      - rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@192.168.xxx.xxx:554/h264Preview_01_sub

# O logger verbosity settings
logger:
  # Optional: Default log verbosity (default: shown below)
  default: info
  # Optional: Component specific logger overrides
  logs:
    frigate.event: debug
    frigate.birdseye: debug

ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
  input_args:
    - -avoid_negative_ts
    - make_zero
    - -fflags
    - +genpts+discardcorrupt+igndts
    - -rtsp_transport
    - tcp
    - -use_wallclock_as_timestamps
    - '1'
  output_args:
    record: preset-record-generic-audio-aac

birdseye:
  enabled: True
  mode: continuous
  restream: true
  width: 1920
  height: 1080
  quality: 4

rtmp:
  enabled: false

detect:
  width: 2560
  height: 1440
  fps: 5
  enabled: true
  max_disappeared: 50

snapshots:
  enabled: true
  timestamp: true
  bounding_box: true

motion:
  improve_contrast: true

objects:
  track:
    - person
    - dog
    - bear
    - car
    - cat
  filters:
    person:
      threshold: 0.75
      min_score: 0.60
    car:
      threshold: 0.80
      min_score: 0.60
    cat:
      threshold: 0.80
      min_score: 0.55
    bear:
      threshold: 0.80
      min_score: 0.55

cameras:
# Other cameras removed for clarity

  garage:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          roles:
            - detect   
            - record
    motion:
      mask:
        - 2855,1324,2499,1298,2540,960,3024,957

    detect:
      width: 4096
      height: 1536

record:
  enabled: true
  retain:
    days: 5
    mode: all

  events:
    pre_capture: 5
    post_capture: 5
    retain: 
      default: 14

detectors:
  coral:
    type: edgetpu
    device: usb

Relevant log output

2023-08-02 21:58:23.076684101  [INFO] Starting Frigate...
2023-08-02 21:58:23.816544178  [2023-08-02 21:58:23] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
2023-08-02 21:58:23.852179298  [2023-08-02 21:58:23] peewee_migrate                 INFO    : Starting migrations
2023-08-02 21:58:23.855634279  [2023-08-02 21:58:23] peewee_migrate                 INFO    : There is nothing to migrate
2023-08-02 21:58:23.864350802  [2023-08-02 21:58:23] detector.coral                 INFO    : Starting detection process: 576
2023-08-02 21:58:23.865429352  [2023-08-02 21:58:23] frigate.app                    INFO    : Output process started: 578
2023-08-02 21:58:23.870063769  [2023-08-02 21:58:23] frigate.app                    INFO    : Camera processor started for frontyard: 584
2023-08-02 21:58:23.872307791  [2023-08-02 21:58:23] frigate.app                    INFO    : Camera processor started for doorbell: 586
2023-08-02 21:58:23.875003905  [2023-08-02 21:58:23] frigate.app                    INFO    : Camera processor started for garage: 587
2023-08-02 21:58:23.878006990  [2023-08-02 21:58:23] frigate.app                    INFO    : Camera processor started for backyard: 589
2023-08-02 21:58:23.880624498  [2023-08-02 21:58:23] frigate.app                    INFO    : Camera processor started for sideyard: 590
2023-08-02 21:58:23.882783988  [2023-08-02 21:58:23] frigate.app                    INFO    : Camera processor started for viewcam: 592
2023-08-02 21:58:23.885546933  [2023-08-02 21:58:23] frigate.app                    INFO    : Capture process started for frontyard: 593
2023-08-02 21:58:23.887830462  [2023-08-02 21:58:23] frigate.app                    INFO    : Capture process started for doorbell: 597
2023-08-02 21:58:23.889988343  [2023-08-02 21:58:23] frigate.app                    INFO    : Capture process started for garage: 602
2023-08-02 21:58:23.892286663  [2023-08-02 21:58:23] frigate.app                    INFO    : Capture process started for backyard: 606
2023-08-02 21:58:23.895257435  [2023-08-02 21:58:23] frigate.app                    INFO    : Capture process started for sideyard: 611
2023-08-02 21:58:23.898710391  [2023-08-02 21:58:23] frigate.app                    INFO    : Capture process started for viewcam: 617
2023-08-02 21:58:26.509506415  [2023-08-02 21:58:23] frigate.detectors.plugins.edgetpu_tfl INFO    : Attempting to load TPU as usb
2023-08-02 21:58:26.513201192  [2023-08-02 21:58:26] frigate.detectors.plugins.edgetpu_tfl INFO    : TPU found

Frigate stats

{"backyard":{"camera_fps":5.1,"capture_pid":606,"detection_enabled":1,"detection_fps":6.2,"ffmpeg_pid":111152,"pid":589,"process_fps":5.1,"skipped_fps":0.0},"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"2.2"},"1":{"cpu":"0.0","mem":"0.0"},"109":{"cpu":"0.0","mem":"0.1"},"111148":{"cpu":"12.3","mem":"0.6"},"111150":{"cpu":"13.3","mem":"0.6"},"111152":{"cpu":"17.7","mem":"0.5"},"115873":{"cpu":"0.0","mem":"0.0"},"115928":{"cpu":"0.0","mem":"0.0"},"115934":{"cpu":"0.0","mem":"0.0"},"115936":{"cpu":"1.3","mem":"0.2"},"134":{"cpu":"0.0","mem":"0.2"},"135":{"cpu":"0.0","mem":"0.0"},"136":{"cpu":"0.0","mem":"0.0"},"137":{"cpu":"0.0","mem":"0.0"},"138":{"cpu":"0.0","mem":"0.0"},"149":{"cpu":"0.0","mem":"0.0"},"15":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"177":{"cpu":"0.0","mem":"0.0"},"207":{"cpu":"0.0","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"250":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"287":{"cpu":"0.0","mem":"0.0"},"29":{"cpu":"0.0","mem":"0.0"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"327":{"cpu":"0.0","mem":"0.0"},"361":{"cpu":"0.0","mem":"0.0"},"40":{"cpu":"0.0","mem":"0.0"},"42":{"cpu":"0.0","mem":"0.0"},"569":{"cpu":"0.0","mem":"0.3"},"575":{"cpu":"0.0","mem":"0.1"},"576":{"cpu":"17.3","mem":"0.8"},"578":{"cpu":"25.3","mem":"0.9"},"584":{"cpu":"12.0","mem":"1.0"},"585":{"cpu":"0.0","mem":"0.1"},"586":{"cpu":"27.7","mem":"1.0"},"587":{"cpu":"12.0","mem":"1.0"},"588":{"cpu":"0.0","mem":"0.1"},"589":{"cpu":"0.3","mem":"1.0"},"590":{"cpu":"14.3","mem":"1.0"},"591":{"cpu":"0.0","mem":"0.1"},"592":{"cpu":"15.7","mem":"1.0"},"593":{"cpu":"2.7","mem":"0.7"},"594":{"cpu":"0.0","mem":"0.1"},"597":{"cpu":"3.3","mem":"0.8"},"600":{"cpu":"0.0","mem":"0.1"},"602":{"cpu":"4.0","mem":"0.8"},"604":{"cpu":"15.3","mem":"0.6"},"606":{"cpu":"3.0","mem":"0.7"},"608":{"cpu":"18.3","mem":"0.6"},"611":{"cpu":"3.7","mem":"0.7"},"612":{"cpu":"0.0","mem":"0.1"},"617":{"cpu":"3.0","mem":"0.7"},"624":{"cpu":"8.7","mem":"0.5"},"626":{"cpu":"12.7","mem":"0.5"},"666":{"cpu":"16.7","mem":"0.6"},"80":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"89":{"cpu":"11.0","mem":"0.2"},"97":{"cpu":"0.0","mem":"0.0"},"98":{"cpu":"4.7","mem":"3.6"},"MiB":{"cpu":"11544.8","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"detection_fps":71.0,"detectors":{"coral":{"detection_start":1691093522.340656,"inference_speed":7.68,"pid":576}},"doorbell":{"camera_fps":5.1,"capture_pid":597,"detection_enabled":1,"detection_fps":15.4,"ffmpeg_pid":604,"pid":586,"process_fps":5.1,"skipped_fps":0.0},"frontyard":{"camera_fps":5.0,"capture_pid":593,"detection_enabled":1,"detection_fps":13.3,"ffmpeg_pid":111148,"pid":584,"process_fps":5.1,"skipped_fps":0.0},"garage":{"camera_fps":5.1,"capture_pid":602,"detection_enabled":1,"detection_fps":14.0,"ffmpeg_pid":608,"pid":587,"process_fps":5.1,"skipped_fps":0.0},"gpu_usages":{"intel-vaapi":{"gpu":"20.66 %","mem":"- %"}},"service":{"last_updated":1691093526,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":470.3,"mount_type":"tmpfs","total":536.9,"used":66.6},"/media/frigate/clips":{"free":610516.0,"mount_type":"ext4","total":3937935.4,"used":3127380.1},"/media/frigate/recordings":{"free":610516.0,"mount_type":"ext4","total":3937935.4,"used":3127380.1},"/tmp/cache":{"free":199550.2,"mount_type":"overlay","total":249444.0,"used":37148.2}},"temperatures":{},"uptime":54823,"version":"0.12.1-367d724"},"sideyard":{"camera_fps":5.1,"capture_pid":611,"detection_enabled":1,"detection_fps":9.3,"ffmpeg_pid":111150,"pid":590,"process_fps":5.1,"skipped_fps":0.0},"viewcam":{"camera_fps":5.1,"capture_pid":617,"detection_enabled":1,"detection_fps":12.8,"ffmpeg_pid":626,"pid":592,"process_fps":5.1,"skipped_fps":0.0}}

Operating system

Debian

Install method

Docker Compose

Coral version

USB

Any other information that may be helpful

CPU: i5-12400, 16GB memory, 4TB SSD, CPU is 75% idle Cameras are Reolink

NickM-27 commented 1 year ago
  1. I'd highly suggest using preset-vaapi for hwaccel args not manual args
  2. Same for input_args, should be using preset-rts-restream

As far as the actual issue at hand, it seems the object gets lost and re-detected continually. If that car is not in an area that you care about then the simplest solution would be to create zones in the areas that you do care about and make those required for events

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.