blakeblackshear / frigate

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

[Support]: Beta 12 person detection #2805

Closed jcastro closed 2 years ago

jcastro commented 2 years ago

Describe the problem you are having

Looks like for some reason the person dection is going on and off constantly. I'm not entirely sure if it's because the config changes I had to make but you can see in the graph how different it was from beta 11 (which was working perfectly)

Version

0.10 beta 12

Frigate config file

mqtt:
  host: 10.0.1.30
  user: mosquitto
  password: []

cameras:
  entrance_cam:
    ffmpeg:
      inputs:
        - path: rtsp://10.0.1.116/11
          roles:
            - detect
    motion:
      threshold: 1
      mask:
        - 399,170,450,181,481,0,415,0
    detect:
      width: 640
      height: 360
      fps: 10
      enabled: True
      max_disappeared: 100
      stationary:
        interval: 10
        threshold: 50
        max_frames:
          default: 3000
          objects:
            person: 1000
    objects:
      track:
        - person
      mask: 399,170,450,181,481,0,415,0
      filters:
        person:
          # Optional: minimum width*height of the bounding box for the detected object (default: 0)
          min_area: 5000
          # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
          max_area: 100000
          # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.65
          # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.75
    record:
      enabled: False
      retain_days: 0
      events:
        retain:
          default: 10

    # Optional: Configuration for the jpg snapshots written to the clips directory for each event
    snapshots:
      # Optional: Enable writing jpg snapshot to /media/frigate/clips (default: shown below)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: False
      # Optional: print a timestamp on the snapshots (default: shown below)
      timestamp: False
      # Optional: draw bounding box on the snapshots (default: shown below)
      bounding_box: True
      # Optional: crop the snapshot (default: shown below)
      crop: False
      # Optional: height to resize the snapshot to (default: original size)
      #height: 480
      # Optional: Restrict snapshots to objects that entered any of the listed zones (default: no required zones)
      required_zones: []
      # Optional: Camera override for retention settings (default: global values)
      retain:
        # Required: Default retention days (default: shown below)
        default: 2
        # Optional: Per object retention days
        objects:
          person: 2

detectors:
  coral:
    type: edgetpu
    device: usb

Relevant log output

[2022-02-14 09:04:40] frigate.app                    INFO    : Starting Frigate (0.10.0-e5714f5)
[2022-02-14 09:04:40] frigate.config                 WARNING : The 'retain_days' config option has been DEPRECATED and will be removed in a future version. Please use the 'days' setting under 'retain'
Starting migrations
[2022-02-14 09:04:40] peewee_migrate                 INFO    : Starting migrations
There is nothing to migrate
[2022-02-14 09:04:40] peewee_migrate                 INFO    : There is nothing to migrate
[2022-02-14 09:04:40] detector.coral                 INFO    : Starting detection process: 225
[2022-02-14 09:04:40] frigate.app                    INFO    : Output process started: 226
[2022-02-14 09:04:40] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2022-02-14 09:04:40] ws4py                          INFO    : Using epoll
[2022-02-14 09:04:40] frigate.app                    INFO    : Camera processor started for entrance_cam: 232
[2022-02-14 09:04:40] frigate.app                    INFO    : Capture process started for entrance_cam: 235
[2022-02-14 09:04:40] ws4py                          INFO    : Using epoll
[2022-02-14 09:04:43] frigate.edgetpu                INFO    : TPU found
[2022-02-14 09:05:36] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56970]
[2022-02-14 09:05:36] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58332]
[2022-02-14 09:05:38] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58332]
expired: 1051
expired: 1051
[2022-02-14 09:11:26] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56970]
[2022-02-14 09:11:26] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56972]
[2022-02-14 09:11:26] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58334]
[2022-02-14 09:11:29] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:58334]
[2022-02-14 09:11:41] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:56972]

FFprobe output from your camera

root@fc1cf738322a:/opt/frigate# ffprobe rtsp://10.0.1.116/11
ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, rtsp, from 'rtsp://10.0.1.116/11':
  Metadata:
    title           : ww live test
  Duration: N/A, start: 0.050000, bitrate: N/A
    Stream #0:0: Video: h264, yuvj420p(pc, progressive), 1280x720, 20 fps, 20 tbr, 90k tbn, 180k tbc

Frigate stats

{"detection_fps":16.4,"detectors":{"coral":{"detection_start":0.0,"inference_speed":7.96,"pid":225}},"entrance_cam":{"camera_fps":10.1,"capture_pid":235,"detection_fps":16.4,"pid":232,"process_fps":10.1,"skipped_fps":0.0},"service":{"storage":{"/dev/shm":{"free":66.2,"mount_type":"tmpfs","total":67.1,"used":0.9},"/media/frigate/clips":{"free":14540.3,"mount_type":"ext4","total":33501.8,"used":17226.6},"/media/frigate/recordings":{"free":14540.3,"mount_type":"ext4","total":33501.8,"used":17226.6},"/tmp/cache":{"free":1000.0,"mount_type":"tmpfs","total":1000.0,"used":0.0}},"temperatures":{},"uptime":343,"version":"0.10.0-e5714f5"}}

Operating system

Proxmox

Install method

Docker Compose

Coral version

USB

Network connection

Wireless

Camera make and model

Aqara G2H

Any other information that may be helpful

Screenshot 2022-02-14 at 09 05 07

Graph detection, going from beta 11 to beta 12

blakeblackshear commented 2 years ago

What values did you have set for stationary settings in beta 11? The example values for max_frames are not the default behavior. You should remove them unless you intended to modify the default behavior.

blakeblackshear commented 2 years ago

Setting max frames to 1000 for person tells frigate to stop tracking stationary person objects after 100 seconds (with 10fps). Is that what you wanted?

jcastro commented 2 years ago

What values did you have set for stationary settings in beta 11? The example values for max_frames are not the default behavior. You should remove them unless you intended to modify the default behavior.

Thank you for the reply. I think I'm having a bit of a hard time understanding the new settings. I'm going to try to re-check documentation and get my mind clcear.

This was my beta 11 config

cameras:
  entrance_cam:
    ffmpeg:
      inputs:
        - path: rtsp://10.0.1.116/11
          roles:
            - detect
    motion:
      threshold: 1
      mask:
        - 399,170,450,181,481,0,415,0
    detect:
      width: 640
      height: 360
      fps: 10
      # Optional: enables detection for the camera (default: True)
      # This value can be set via MQTT and will be updated in startup based on retained value
      enabled: True
      # Optional: Number of frames without a detection before frigate considers an object to be gone. (default: 5x the frame rate)
      max_disappeared: 250
      stationary_interval: 90
    objects:
      track:
        - person
      mask: 399,170,450,181,481,0,415,0
      filters:
        person:
          # Optional: minimum width*height of the bounding box for the detected object (default: 0)
          min_area: 5000
          # Optional: maximum width*height of the bounding box for the detected object (default: 24000000)
          max_area: 100000
          # Optional: minimum score for the object to initiate tracking (default: shown below)
          min_score: 0.65
          # Optional: minimum decimal percentage for tracked object's computed score to be considered a true positive (default: shown below)
          threshold: 0.75
blakeblackshear commented 2 years ago

To get the same behavior as beta 11, just specify the same settings you had before rather than adding new settings. This will tell frigate to check stationary objects once every 90 frames regardless of whether or not there is motion.

cameras:
  entrance_cam:
    ...
    detect:
      ...
      stationary:
        interval: 90