roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.51k stars 155 forks source link

How to make two AI detection models work under one camera. #703

Open LZZJ opened 5 months ago

LZZJ commented 5 months ago

Here is my configuration file.

mqtt: broker: xxxx port: xxxx username: xxx password: xxx client_id: xxx

ffmpeg: camera: thoughtallroomtest1: # This value has to be unique across all cameras name: thoughtallroomtest1 host: xxxxxxxx # port: xxxxxxx # path: xxxxxxx #.live.flv # username: # password: # stream_format: rtsp protocol: rtsp

codec: h264_cuvid

  # width: 1920
  # height: 1080
  fps: 15
  mjpeg_streams:
    static:
      # rotate: 180
      # width: 100
      # height: 100
      draw_objects: true
      draw_zones: true
      draw_object_mask: true
      draw_motion: true

You can also use motion detection

mog2: motion_detector: cameras: thoughtallroomtest1: fps: 1

To tie everything together we need to configure one more component.

nvr: thoughtallroomtest1:

fireserver: host: xxx port: xxx model_name: ppdet model_version: "1" label_path: "viseron/components/fireserver/labels" object_detector: cameras: thoughtallroomtest1: # Attach detector to the configured camera_1 above fps: 1 scan_on_motion_only: true # Scan for objects even when there is no motion labels:

fastdeployserver: host: xxx port: xxx model_name: ppdet model_version: "1" label_path: "viseron/components/fastdeployserver/labels" object_detector: cameras: thoughtallroomtest1: # Attach detector to the configured camera_1 above fps: 1 scan_on_motion_only: true # Scan for objects even when there is no motion labels:

roflcoopter commented 5 months ago

Not possible to have multiple sadly. What you need to do is what you described, specify two entries under ffmpeg pointing to the same camera.

What is your use case for this?