From 0ce2f6d411a5bd0e36137b3dddf38d2b321725f7 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Tue, 15 Apr 2025 06:50:22 -0600 Subject: [PATCH] Add hwnc --- frigate/detectors/detector_config.py | 1 + frigate/object_detection/util.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/frigate/detectors/detector_config.py b/frigate/detectors/detector_config.py index 2c54d11e5a..29d589fcc5 100644 --- a/frigate/detectors/detector_config.py +++ b/frigate/detectors/detector_config.py @@ -25,6 +25,7 @@ class PixelFormatEnum(str, Enum): class InputTensorEnum(str, Enum): nchw = "nchw" nhwc = "nhwc" + hwnc = "hwnc" class InputDTypeEnum(str, Enum): diff --git a/frigate/object_detection/util.py b/frigate/object_detection/util.py index ffdb1eca45..4f31dfb75e 100644 --- a/frigate/object_detection/util.py +++ b/frigate/object_detection/util.py @@ -1,7 +1,7 @@ """Object detection utilities.""" -import threading import queue +import threading from numpy import ndarray @@ -71,3 +71,5 @@ def tensor_transform(desired_shape: InputTensorEnum): return None elif desired_shape == InputTensorEnum.nchw: return (0, 3, 1, 2) + elif desired_shape == InputTensorEnum.hwnc: + return (1, 2, 0, 3)