NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Improve Intel Model (#20541)
Nicolas Mowen42288618100c
diff --git a/docs/docs/configuration/object_detectors.md b/docs/docs/configuration/object_detectors.mdindex 230c6c3cb4..540a9b0e95 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:::<details>- <summary>YOLO-NAS Setup & Config</summary>+ <summary>D-FINE Setup & Config</summary>After placing the downloaded onnx model in your config/model_cache folder, you can use the following configuration:@@ -445,7 +445,7 @@ model:height: 640input_tensor: nchwinput_dtype: float- path: /config/model_cache/dfine_s_obj2coco.onnx+ path: /config/model_cache/dfine-s.onnxlabelmap_path: /labelmap/coco-80.txt```diff --git a/docs/docs/frigate/hardware.md b/docs/docs/frigate/hardware.mdindex 95fc488b04..f6f647ec8e 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.pyindex c1bc98c6c8..0b4f319a85 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 namefor input_name, input_data in inputs.items():- # Find the input by name+ # Find the input by name and its indexinput_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 = idxbreakif 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 inferenceself.infer_request.infer()