From be57c8872d7bcff586fcc11f092a7161b5ee224c Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Thu, 4 Jan 2024 15:52:40 +0100 Subject: [PATCH] make ruff happy --- examples/count_people_in_zone/inference_example.py | 11 ++++++----- supervision/detection/core.py | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/count_people_in_zone/inference_example.py b/examples/count_people_in_zone/inference_example.py index bed9b2c3..6fd0f340 100644 --- a/examples/count_people_in_zone/inference_example.py +++ b/examples/count_people_in_zone/inference_example.py @@ -68,12 +68,13 @@ def detect( frame: np.ndarray, model: RoboflowInferenceModel, confidence_threshold: float = 0.5 ) -> sv.Detections: """ - Detect objects in a frame using a Inference model, filtering detections by class ID and - confidence threshold. + Detect objects in a frame using Inference model, filtering detections by class ID + and confidence threshold. Args: frame (np.ndarray): The frame to process, expected to be a NumPy array. - model (RoboflowInferenceModel): The Inference model used for processing the frame. + model (RoboflowInferenceModel): The Inference model used for processing the + frame. confidence_threshold (float, optional): The confidence threshold for filtering detections. Default is 0.5. @@ -82,8 +83,8 @@ def detect( model. Note: - This function is specifically tailored for an Inference model and assumes class ID 0 - for filtering. + This function is specifically tailored for an Inference model and assumes class + ID 0 for filtering. """ results = model.infer(frame)[0] detections = sv.Detections.from_inference(results) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 59d0cc11..39e129e1 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -448,7 +448,8 @@ class Detections: def from_roboflow(cls, roboflow_result: Union[dict, Any]) -> Detections: """ Create a Detections object from the [Roboflow](https://roboflow.com/) - API inference result or the [Inference](https://inference.roboflow.com/) package results. + API inference result or the [Inference](https://inference.roboflow.com/) + package results. Args: roboflow_result (dict): The result from the