Hardware advice to improve Frigate

I am running my HA on a Dell CFC5C OptiPlex 3050 Micro Form Factor Desktop Computer, Intel Core i5-7500T, 8GB DDR4, and one 256GB Solid State Drive.

I consistently get the message in the lower right corner of the browser indicating “Cpu is slow (95.61 ms)

What can I do to the hardware to improve this?

Here are some screen captures of the Frigate > System metrics:

Your inference speeds are 93ms. Get a coral TPU.

My inference speeds are 8ms per TPU. I have 2.

No way your keeping up with detected objects so I expect you have many missed detections and ultimately your system is not working well

At 93ms your system can only check 10 frames max per second total. Even a single camera at 5fps is pushing your system limits. You can reduce frame rates to help this but ultimately you need more detection throughput

@tmjpugh - Thank you for your prompt response and advice.

How many coral TPUs can you add to a pc? Do you also recommend adding RAM, and an additional SSD?

Here is my partial frigate.yaml:

  camera6:
    enabled: true
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        - path: rtsp://admin:PASSWORD@IP:554/cam/realmonitor?channel=6&subtype=1
          input_args: preset-rtsp-restream
          roles:
            - detect
        - path: rtsp://admin:PASSWORD@IP:554/cam/realmonitor?channel=6&subtype=0
          roles:
            - record
    detect:
      width: 1280 # <- optional, by default Frigate tries to automatically detect resolution
      height: 720 # <- optional, by default Frigate tries to automatically detect resolution
      fps: 5
      stationary:
        interval: 20
        threshold: 50
    # object track

1 coral is all you need

I have dual TPU card

1 Like

It looks like you are using CPU detection?
Before you start buying more hardware it might be worth trying using OpenVino to get your inference time down. It uses your CPUs integrated GPU for acceleration and can be quite effective. On my super low power CPU I get < 50ms, your iGPU is faster so you should get even better results.

detectors:
  ov:
    type: openvino
    device: CPU

model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  path: /openvino-model/ssdlite_mobilenet_v2.xml
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt
1 Like

I will give it a try. Thank you

And, in general, before GPU processing was a thing, more ram was always the best thing to upgrade first…

Not sure if that is the case in this situation, but it is always my go to upgrade.

1 Like

using a CPU detector is absolutely discouraged. As @reef-actor suggested, the best first step here is to use openvino Object Detectors | Frigate

1 Like

Here is an update.

Please see the results below, after adding 1 Coral TPU USB.

Would a 2nd Coral TPU USB help the performance, or should I add an additional box dedicated to Frigate?

I think around 10ms is the limit of the USB ones if I remember correctly. Only way to get lower is either a PCI-E one or go down a proper GPU route.
My Dual PCI-E Coral on a PCI-E splitter is around 6.3ms each. But unless you run a lot of cameras you won’t really gain anything.

1 Like

Is the 10ms is the limit of “Detector Inference Speed”?

I have 8 cameras now, but planning to put up to 4 more! Would this setup be enough for 12 cameras?

What do you think of overall results now?

only if you consistently have skipped frames in the cameras metrics tab

it depends on the model and other factors