From bdd196f8f682e0fc7000d8280bebec5cbdd12e9b Mon Sep 17 00:00:00 2001 From: abinila siva <163017635+abinila4@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:40:19 -0400 Subject: [PATCH] Update memryx.py --- frigate/detectors/plugins/memryx.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frigate/detectors/plugins/memryx.py b/frigate/detectors/plugins/memryx.py index d49a7d30b..7f1b97382 100644 --- a/frigate/detectors/plugins/memryx.py +++ b/frigate/detectors/plugins/memryx.py @@ -38,6 +38,7 @@ class MemryXDetector(DetectionApi): ModelTypeEnum.ssd, ModelTypeEnum.yolonas, ModelTypeEnum.yolov9, + ModelTypeEnum.yolov8, ModelTypeEnum.yolox, ] @@ -61,10 +62,15 @@ class MemryXDetector(DetectionApi): if self.memx_model_type == ModelTypeEnum.yolov9: self.model_url = "https://developer.memryx.com/example_files/1p2_frigate/yolov9.zip" - # self.expected_post_model = "YOLO_v9_small_640_640_3_onnx_post.onnx" + + elif self.memx_model_type == ModelTypeEnum.yolov8: + self.model_url = "https://developer.memryx.com/example_files/1p2_frigate/yolov8.zip" + + if self.memx_model_type in [ModelTypeEnum.yolov8, ModelTypeEnum.yolov9]: + # Shared constants for both yolov8 and yolov9 self.const_A = np.load("/memryx_models/yolov9/_model_22_Constant_9_output_0.npy") self.const_B = np.load("/memryx_models/yolov9/_model_22_Constant_10_output_0.npy") - self.const_C = np.load("/memryx_models/yolov9/_model_22_Constant_12_output_0.npy") + self.const_C = np.load("/memryx_models/yolov9/_model_22_Constant_12_output_0.npy") elif self.memx_model_type == ModelTypeEnum.yolonas: self.model_url = "https://developer.memryx.com/example_files/1p2_frigate/yolo_nas.zip" @@ -405,7 +411,7 @@ class MemryXDetector(DetectionApi): def process_output(self, *outputs): - if self.memx_model_type == ModelTypeEnum.yolov9: + if self.memx_model_type in [ModelTypeEnum.yolov8, ModelTypeEnum.yolov9]: outputs = [np.expand_dims(tensor, axis=0) for tensor in outputs] # Shape: (1, H, W, C) # Move channel axis from 3rd (last) position to 1st position → (1, C, H, W)