From 09ac377648b9759f4ae92613ffb7d0bdebf2eca2 Mon Sep 17 00:00:00 2001 From: Sergey Krashevich Date: Mon, 8 May 2023 06:55:52 +0300 Subject: [PATCH] Update DeepStack detector to set width and height from input image size --- frigate/detectors/plugins/deepstack.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frigate/detectors/plugins/deepstack.py b/frigate/detectors/plugins/deepstack.py index 716065903c..d54bb32afb 100644 --- a/frigate/detectors/plugins/deepstack.py +++ b/frigate/detectors/plugins/deepstack.py @@ -33,9 +33,6 @@ def __init__(self, detector_config: DeepstackDetectorConfig): self.api_key = detector_config.api_key self.labels = detector_config.model.merged_labelmap - self.h = detector_config.model.height - self.w = detector_config.model.width - def get_label_index(self, label_value): if label_value.lower() == "truck": label_value = "car" @@ -47,6 +44,7 @@ def get_label_index(self, label_value): def detect_raw(self, tensor_input): image_data = np.squeeze(tensor_input).astype(np.uint8) image = Image.fromarray(image_data) + self.w, self.h = image.size with io.BytesIO() as output: image.save(output, format="JPEG") image_bytes = output.getvalue()