Terrible detections accuracy #6627
Replies: 5 comments 25 replies
-
At 640x360, I wouldn't expect accurate detections on people that don't fill most of the frame. Do you have the ability to set a substream to 720p with a fps of 5? Unless you have very fast objects, there isn't a good reason to have your detect fps set to 10. |
Beta Was this translation helpful? Give feedback.
-
So I dropped the cameras down to 5 fps and now I'm getting a crash. I've changed nothing else. Here's a sample, its thousands and thousands of these:
and these:
|
Beta Was this translation helpful? Give feedback.
-
So where in Frigate is the cache storage specified? Is that in the Docker compose? I configured that to be 256 after reading how to calculate it based on cameras and resolutions. The disk Frigate is running on is a 240GB SSD and recording storage is a TrueNAS iSCSI target. |
Beta Was this translation helpful? Give feedback.
-
I've also found my sub stream for the 4 Hikvisions can go slightly higher so I've done that to remove the resizing on CPU that seems to be happening. Running htop shows each camera spikes to ~20-25% when detecting otherwise just a couple of %. However go2rtc seems to be using 40-50% CPU constantly. GPU use still seems to be around 2%. Current config: mqtt:
enabled: true
host: 192.168.1.10
port: 1883
user: frigate_mqtt
password: passwordhere
detectors:
coral:
type: edgetpu
device: usb
objects:
track:
- person
- dog
- bird
- cat
- bicycle
- car
- motorcycle
- horse
snapshots:
enabled: true
timestamp: true
cameras:
Front_Door:
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: user://127.0.0.1:8554/Front_Door
roles:
- record
- path: user://127.0.0.1:8554/Front_Door_Sub
roles:
- detect
record:
enabled: true
events:
pre_capture: 15
post_capture: 15
detect:
width: 640
height: 480
fps: 5
Front_Garden:
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: user://127.0.0.1:8554/Front_Garden
roles:
- record
- path: user://127.0.0.1:8554/Front_Garden_Sub
roles:
- detect
record:
enabled: true
events:
pre_capture: 15
post_capture: 15
detect:
width: 640
height: 480
fps: 5
Utility_External:
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: user://127.0.0.1:8554/Utility_External
roles:
- record
- path: user://127.0.0.1:8554/Utility_External_Sub
roles:
- detect
record:
enabled: true
events:
pre_capture: 15
post_capture: 15
detect:
width: 640
height: 480
fps: 5
Office_External:
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: user://127.0.0.1:8554/Office_External
roles:
- record
- path: user://127.0.0.1:8554/Office_External_Sub
roles:
- detect
record:
enabled: true
events:
pre_capture: 15
post_capture: 15
detect:
width: 640
height: 480
fps: 5
motion:
mask:
- 440,0,392,360,640,360,640,45,640,0
Garage:
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: user://127.0.0.1:8554/Garage
roles:
- record
- path: user://127.0.0.1:8554/Garage_Sub
roles:
- detect
record:
enabled: true
events:
pre_capture: 15
post_capture: 15
detect:
width: 640
height: 360
fps: 5
Back_Door:
ffmpeg:
hwaccel_args: preset-vaapi
inputs:
- path: user://127.0.0.1:8554/Back_Door
roles:
- record
- path: user://127.0.0.1:8554/Back_Door_Sub
roles:
- detect
record:
enabled: true
retain:
days: 14
mode: motion
events:
retain:
default: 14
mode: active_objects
pre_capture: 15
post_capture: 15
detect:
width: 640
height: 360
fps: 5
go2rtc:
streams:
Front_Door:
- user://user:[email protected]:554/Streaming/channels/101
Front_Door_Sub:
- user://user:[email protected]:554/Streaming/channels/102
Front_Garden:
- user://user:[email protected]:554/Streaming/channels/101
Front_Garden_Sub:
- user://user:[email protected]:554/Streaming/channels/102
Utility_External:
- user://user:[email protected]:554/Streaming/channels/101
Utility_External_Sub:
- user://user:[email protected]:554/Streaming/channels/102
Office_External:
- user://user:[email protected]:554/Streaming/channels/101
Office_External_Sub:
- user://user:[email protected]:554/Streaming/channels/102
Garage:
- user://user:[email protected]/av_stream/ch0
Garage_Sub:
- user://user:[email protected]/av_stream/ch1
Back_Door:
- user://user:[email protected]/av_stream/ch0
Back_Door_Sub:
- user://user:[email protected]/av_stream/ch1
webrtc:
candidates:
- 192.168.1.4:8555
- stun:8555 |
Beta Was this translation helpful? Give feedback.
-
So I think I've misunderstood how things work then? The main stream I thought was just used for viewing and the decoding should be done by the cpu via quick sync/vaapi. The sub streams which are lower resolution are used for detection. Again decoding is done by the GPU and CPU just checks for motion on these streams then passes frames to Coral for detection. It looks like I need higher resolution sub streams for better detections which I was hoping I could resize the main stream on the GPU. Apart from detecting motion I didn't think the CPU should be doing much? |
Beta Was this translation helpful? Give feedback.
-
Hoping I can get some advice.
I've managed to get a config that seems pretty stable but my detections are terrible. Plant pots detected as people, people/dog/horse detections of a pile of things in a hall etc. This is annoying as I have Home Assistant setup to send me an alert when I'm away, I'm getting quite a few detections an hour of non-moving objects as people/various other things. I've had to turn the notifications off so its essentially useless.
I've seen that the default model may not be the best model for CCTV but I also think the sub stream of my cameras may be too low a resolution. I tried to use the record stream for the detect stream but resized the resolution to 1080p after reading that resizing should be carried out by my Intel GPU with vaapi configured. However the GPU usage goes up from 5 to 10% and CPU per camera goes from 14% to 60%. It also resulted in huge amounts of errors and regular crashes with the cameras page not showing live images anymore. Perhaps my Intel GPU isn't being used as I thought it was?
I'm running Frigate in Docker on Ubuntu Server on a Dell Wyse 5070 with USB Coral (Intel J4105 CPU), 8GB RAM. I have 2 cheap 1080P PTZ cameras and the rest are 4MP Hikvisions. What am I doing wrong/what can I do to improve the detection accuracy?
I used a lightly modified version of the default Docker compose in the Frigate documentation.
My stable config file but with poor accuracy in detections is:
The config file where I tried to raise the detection resolution to 1080P but it broke everything was:
Beta Was this translation helpful? Give feedback.
All reactions