[HW Accel Support]: onnx detector performance drop #19741
Replies: 3 comments 20 replies
-
You're seeing a performance drop because ONNX runtime and TensorRT are two different inference engines, and their efficiency can vary depending on the model and hardware. In Frigate 0.16, the ONNX detector is used for YOLO-NAS, YOLOv9, and YOLOX models on Nvidia GPUs by default, but it does not use native TensorRT acceleration in the same way as the dedicated TensorRT detector from previous versions(1). This can result in higher inference times, especially for more complex models(1). You can still use TensorRT for YOLO models by specifying the correct detector type and ensuring your model is preprocessed for TensorRT, but ONNX is the expected runtime for YOLO-NAS and YOLOv9 in the latest Frigate configuration(1)(2). There is no default ONNX model provided; supported formats include YOLO-NAS, YOLOv3/v4/v7/v9, YOLOX, RF-DETR, and D-FINE(2). If you want to maximize performance and use TensorRT directly, follow the configuration guidance for the TensorRT detector and ensure you use the correct Frigate image (with the -tensorrt tag) and preprocessed TRT engine files(1). For ONNX, you can try different models or adjust the model input size, but ONNX runtime on Nvidia may not match TensorRT speeds for all models(1)(2). For reference on supported detectors and models, see: 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
Following this. Just tried switching from Coral to my spare GTX 1080, and though I can confirm ONNX is using the GPU as expected (I see the frigate.detector.onnx process in nividia-smi), I'm getting what seems to me like unreasonably slow inference times of ~30ms. What I've tried:
I really don't want to switch back to the coral as it just can't run the newer, more accurate models, but with the number of cameras I have-- even with 5fps, low-res detect streams-- 25-30ms+ just won't cut it. I never tried the tensorrt detector with .trt models, but now that it's gone from 16.0 there doesn't seem to be much point. My config.yml:
|
Beta Was this translation helpful? Give feedback.
-
In the source code, I see some tensorrt stuff is disabled by default. Is there a recommended way to activate this? Lines 312 to 338 in c723164 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
Hi, I'm using a MSI RTX 3060 12Gb on my frigate system. Recenty, I updated from 0.15.2 to 0.16.
On 0.15.2, I used the yolov7-320 model with tensorrt. Detector inference speed is 5-7ms.
On 0.16, I moved to onnx runtime according to release notes. I got some performance drop on inference timings. I got these results.
Version
0.16
Frigate config file
docker-compose file or Docker CLI command
Relevant Frigate log output
Relevant go2rtc log output
FFprobe output from your camera
Install method
Docker Compose
Object Detector
TensorRT
Network connection
Wired
Camera make and model
hikvision
Screenshots of the Frigate UI's System metrics pages
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions