blakeblackshear / frigate

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

[Support]: zone based object detection not working #3049

Closed lcasale closed 2 years ago

lcasale commented 2 years ago

Describe the problem you are having

I'm trying to break my driveway camera into zones to avoid vehicle detection on the main street. However, only the person object is being applied to the camera and zones unless I add vehicle tracking to the camera level but then it's not restricted to the zone I want to track vehicles. I've mimicked the configuration here but it doesn't seem to be working.

Version

0.10.1-83481af

Frigate config file

mqtt:
  host: ****
  port: 1883
  topic_prefix: frigate
  client_id: frigate
  user: ****
  password: ****
  stats_interval: 60
model:
  labelmap:
    2: vehicle
    3: vehicle
    5: vehicle
    7: vehicle
    15: animal
    16: animal
    17: animal
    18: animal
    19: animal
    22: animal
cameras:
  driveway:
    ffmpeg:
      inputs:
        - path: 'rtsp://****:554/cam/realmonitor?channel=1&subtype=0'
          roles:
            - detect
        - path: 'rtsp://****:554/cam/realmonitor?channel=1&subtype=0'
          roles:
            - record
            - rtmp
    record:
      enabled: True
      events:
        required_zones:
          - driveway_end
          - driveway_full
    snapshots:
      required_zones:
        - driveway_end
        - driveway_full
    zones:
      driveway_end:
        coordinates: 601,480,0,480,0,110,84,95,154,84,259,73,375,116
        objects:
          - vehicle
      driveway_full:
        coordinates: 0,480,704,480,704,0,0,0
        objects:
          - person
          - animal
    detect:
      width: 704
      height: 480
      fps: 5
    mqtt:
      bounding_box: true
      quality: 100  
snapshots:
  enabled: True
  timestamp: False
  bounding_box: True
  crop: False
  quality: 100
  retain:
    default: 7
record:
  enabled: true
  retain:
    days: 7
    mode: motion
  events:
    pre_capture: 15
    post_capture: 15
    retain:
      default: 7
      mode: active_objects
detectors:
 coral:
   type: edgetpu
   device: pci
logger:
  default: debug

Relevant log output

N/A

FFprobe output from your camera

N/A

Frigate stats

No response

Operating system

Debian

Install method

Docker Compose

Coral version

PCIe

Network connection

Wired

Camera make and model

Amcrest IP5M-T1179EW

Any other information that may be helpful

No response

blakeblackshear commented 2 years ago

You have to list all objects you want to track at the camera level. Just adding them at the zone level won't do anything if the camera isn't set to look for those objects.

With the config you posted, you should only get events of vehicles if they enter the driveway_end zone.

lcasale commented 2 years ago

I originally had them in the camera object (below), but I was getting vehicle alerts outside of the driveway_end zone.

objects:
      track:
        - vehicle
        - bicycle
        - person
        - animal
NickM-27 commented 2 years ago

I originally had them in the camera object (below), but I was getting vehicle alerts outside of the driveway_end zone.

objects:
      track:
        - vehicle
        - bicycle
        - person
        - animal

If you can provide a screenshot of the camera with the zone along with examples of vehicles outside the zone then we can help give guidance. You may know this but do keep in mind that zones are triggered based on the bottom center of the objects bounding box.

lcasale commented 2 years ago

You may know this but do keep in mind that zones are triggered based on the bottom center of the objects bounding box.

Ahh that's what's going on. The street is on an angle so the bottom of the bounding box was clipping the zone thus triggering. Thanks for the quick replies!