From a92bd60742ec916b56923ee4563cf0bcba65c3a3 Mon Sep 17 00:00:00 2001 From: MarcA711 <40744649+MarcA711@users.noreply.github.com> Date: Fri, 17 May 2024 16:15:39 +0000 Subject: [PATCH] fix formatting --- frigate/detectors/detection_api.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/frigate/detectors/detection_api.py b/frigate/detectors/detection_api.py index b4b5f43e3..6e1224272 100644 --- a/frigate/detectors/detection_api.py +++ b/frigate/detectors/detection_api.py @@ -1,8 +1,10 @@ import logging -from frigate.detectors.detector_config import ModelTypeEnum from abc import ABC, abstractmethod + import numpy as np +from frigate.detectors.detector_config import ModelTypeEnum + logger = logging.getLogger(__name__) @@ -54,20 +56,24 @@ class DetectionApi(ABC): boxes = np.transpose( np.vstack( ( - boxes[:, 1]/self.height, - boxes[:, 0]/self.width, - boxes[:, 3]/self.height, - boxes[:, 2]/self.width, + boxes[:, 1] / self.height, + boxes[:, 0] / self.width, + boxes[:, 3] / self.height, + boxes[:, 2] / self.width, ) ) ) - results = np.hstack((class_ids[..., np.newaxis], scores[..., np.newaxis], boxes)) + results = np.hstack( + (class_ids[..., np.newaxis], scores[..., np.newaxis], boxes) + ) - return np.resize(results, (20,6)) + return np.resize(results, (20, 6)) def post_process(self, output): if self.detector_config.model.model_type == ModelTypeEnum.yolonas: return self.yolonas(output) else: - raise ValueError(f'Model type "{self.detector_config.model.model_type}" is currently not supported.') \ No newline at end of file + raise ValueError( + f'Model type "{self.detector_config.model.model_type}" is currently not supported.' + )