From 42288618100c61e6129443fa5581fc85fff5e9fc Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 17 Oct 2025 06:31:28 -0600 Subject: [PATCH] Improve Intel Model (#20541) * Update supported models and inference times * Fix d-fine inputs * Improve d-fine --- docs/docs/configuration/object_detectors.md | 6 +++--- docs/docs/frigate/hardware.md | 4 ++-- frigate/detectors/detection_runners.py | 10 ++++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/docs/configuration/object_detectors.md b/docs/docs/configuration/object_detectors.md index 230c6c3cb..540a9b0e9 100644 --- a/docs/docs/configuration/object_detectors.md +++ b/docs/docs/configuration/object_detectors.md @@ -281,7 +281,7 @@ detectors: | ------------------------------------- | --- | --- | ------------------------------------------------------------ | | [YOLOv9](#yolo-v3-v4-v7-v9) | ✅ | ✅ | Recommended for GPU & NPU | | [RF-DETR](#rf-detr) | ✅ | ✅ | Requires XE iGPU or Arc | -| [YOLO-NAS](#yolo-nas) | ✅ | ⚠️ | YOLO-NAS only works on NPU in non-flat format | +| [YOLO-NAS](#yolo-nas) | ✅ | ✅ | | | [MobileNet v2](#ssdlite-mobilenet-v2) | ✅ | ✅ | Fast and lightweight model, less accurate than larger models | | [YOLOX](#yolox) | ✅ | ? | | | [D-FINE](#d-fine) | ❌ | ❌ | | @@ -429,7 +429,7 @@ Currently D-FINE models only run on OpenVINO in CPU mode, GPUs currently fail to :::
- YOLO-NAS Setup & Config + D-FINE Setup & Config After placing the downloaded onnx model in your config/model_cache folder, you can use the following configuration: @@ -445,7 +445,7 @@ model: height: 640 input_tensor: nchw input_dtype: float - path: /config/model_cache/dfine_s_obj2coco.onnx + path: /config/model_cache/dfine-s.onnx labelmap_path: /labelmap/coco-80.txt ``` diff --git a/docs/docs/frigate/hardware.md b/docs/docs/frigate/hardware.md index 95fc488b0..f6f647ec8 100644 --- a/docs/docs/frigate/hardware.md +++ b/docs/docs/frigate/hardware.md @@ -167,8 +167,8 @@ Inference speeds vary greatly depending on the CPU or GPU used, some known examp | Intel UHD 770 | ~ 15 ms | t-320: ~ 16 ms s-320: ~ 20 ms s-640: ~ 40 ms | 320: ~ 20 ms 640: ~ 46 ms | | | | Intel N100 | ~ 15 ms | s-320: 30 ms | 320: ~ 25 ms | | Can only run one detector instance | | Intel N150 | ~ 15 ms | t-320: 16 ms s-320: 24 ms | | | | -| Intel Iris XE | ~ 10 ms | s-320: 8 ms s-640: 30 ms | 320: ~ 18 ms 640: ~ 50 ms | 320-n: 33 ms | | -| Intel NPU | ~ 6 ms | s-320: 11 ms | | 320-n: 40 ms | | +| Intel Iris XE | ~ 10 ms | t-320: 6 ms t-640: 14 ms s-320: 8 ms s-640: 16 ms | 320: ~ 10 ms 640: ~ 20 ms | 320-n: 33 ms | | +| Intel NPU | ~ 6 ms | s-320: 11 ms | 320: ~ 14 ms 640: ~ 34 ms | 320-n: 40 ms | | | Intel Arc A310 | ~ 5 ms | t-320: 7 ms t-640: 11 ms s-320: 8 ms s-640: 15 ms | 320: ~ 8 ms 640: ~ 14 ms | | | | Intel Arc A380 | ~ 6 ms | | 320: ~ 10 ms 640: ~ 22 ms | 336: 20 ms 448: 27 ms | | | Intel Arc A750 | ~ 4 ms | | 320: ~ 8 ms | | | diff --git a/frigate/detectors/detection_runners.py b/frigate/detectors/detection_runners.py index c1bc98c6c..0b4f319a8 100644 --- a/frigate/detectors/detection_runners.py +++ b/frigate/detectors/detection_runners.py @@ -312,11 +312,13 @@ class OpenVINOModelRunner(BaseModelRunner): # Multiple inputs case - set each input by name for input_name, input_data in inputs.items(): - # Find the input by name + # Find the input by name and its index input_port = None - for port in self.compiled_model.inputs: + input_index = None + for idx, port in enumerate(self.compiled_model.inputs): if port.get_any_name() == input_name: input_port = port + input_index = idx break if input_port is None: @@ -327,8 +329,8 @@ class OpenVINOModelRunner(BaseModelRunner): input_tensor = ov.Tensor(input_element_type, input_data.shape) np.copyto(input_tensor.data, input_data) - # Set the input tensor - self.infer_request.set_input_tensor(input_tensor) + # Set the input tensor for the specific port index + self.infer_request.set_input_tensor(input_index, input_tensor) # Run inference self.infer_request.infer()