From 3434c0657025067dbc5ec1d4be20ca3726a0bb71 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 10:28:02 +0000 Subject: [PATCH] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20form?= =?UTF-8?q?at=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/time_in_zone/inference_file_example.py | 4 ++-- .../inference_pipeline_stream_example.py | 14 +++++--------- examples/time_in_zone/inference_stream_example.py | 4 ++-- examples/time_in_zone/ultralytics_file_example.py | 4 ++-- .../ultralytics_pipeline_stream_example.py | 7 +++---- .../time_in_zone/ultralytics_stream_example.py | 4 ++-- examples/time_in_zone/utils/timers.py | 1 + 7 files changed, 17 insertions(+), 21 deletions(-) diff --git a/examples/time_in_zone/inference_file_example.py b/examples/time_in_zone/inference_file_example.py index f736009c1..5feb1d836 100644 --- a/examples/time_in_zone/inference_file_example.py +++ b/examples/time_in_zone/inference_file_example.py @@ -4,10 +4,10 @@ import cv2 import numpy as np from inference import get_model +from utils.general import find_in_list, load_zones_config +from utils.timers import FPSBasedTimer import supervision as sv -from utils.general import load_zones_config, find_in_list -from utils.timers import FPSBasedTimer COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"]) COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS) diff --git a/examples/time_in_zone/inference_pipeline_stream_example.py b/examples/time_in_zone/inference_pipeline_stream_example.py index 60276036d..e1fae57f9 100644 --- a/examples/time_in_zone/inference_pipeline_stream_example.py +++ b/examples/time_in_zone/inference_pipeline_stream_example.py @@ -5,10 +5,10 @@ import numpy as np from inference import InferencePipeline from inference.core.interfaces.camera.entities import VideoFrame +from utils.general import find_in_list, load_zones_config +from utils.timers import ClockBasedTimer import supervision as sv -from utils.general import load_zones_config, find_in_list -from utils.timers import ClockBasedTimer COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"]) COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS) @@ -90,7 +90,6 @@ def main( iou: float, classes: List[int], ) -> None: - sink = CustomSink(zone_configuration_path=zone_configuration_path, classes=classes) pipeline = InferencePipeline.init( @@ -98,7 +97,7 @@ def main( video_reference=rtsp_url, on_prediction=sink.on_prediction, confidence=confidence, - iou_threshold=iou + iou_threshold=iou, ) pipeline.start() @@ -126,10 +125,7 @@ def main( help="Complete RTSP URL for the video stream.", ) parser.add_argument( - "--model_id", - type=str, - default="yolov8s-640", - help="Roboflow model ID." + "--model_id", type=str, default="yolov8s-640", help="Roboflow model ID." ) parser.add_argument( "--confidence_threshold", @@ -159,4 +155,4 @@ def main( confidence=args.confidence_threshold, iou=args.iou_threshold, classes=args.classes, - ) \ No newline at end of file + ) diff --git a/examples/time_in_zone/inference_stream_example.py b/examples/time_in_zone/inference_stream_example.py index 52876088c..dd2d68a5d 100644 --- a/examples/time_in_zone/inference_stream_example.py +++ b/examples/time_in_zone/inference_stream_example.py @@ -4,10 +4,10 @@ import cv2 import numpy as np from inference import get_model +from utils.general import find_in_list, get_stream_frames_generator, load_zones_config +from utils.timers import ClockBasedTimer import supervision as sv -from utils.general import load_zones_config, find_in_list, get_stream_frames_generator -from utils.timers import ClockBasedTimer COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"]) COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS) diff --git a/examples/time_in_zone/ultralytics_file_example.py b/examples/time_in_zone/ultralytics_file_example.py index 587ef7fa5..fe8ce58df 100644 --- a/examples/time_in_zone/ultralytics_file_example.py +++ b/examples/time_in_zone/ultralytics_file_example.py @@ -4,10 +4,10 @@ import cv2 import numpy as np from ultralytics import YOLO +from utils.general import find_in_list, load_zones_config +from utils.timers import FPSBasedTimer import supervision as sv -from utils.general import load_zones_config, find_in_list -from utils.timers import FPSBasedTimer COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"]) COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS) diff --git a/examples/time_in_zone/ultralytics_pipeline_stream_example.py b/examples/time_in_zone/ultralytics_pipeline_stream_example.py index cfa2ad78a..25dc874f8 100644 --- a/examples/time_in_zone/ultralytics_pipeline_stream_example.py +++ b/examples/time_in_zone/ultralytics_pipeline_stream_example.py @@ -6,10 +6,10 @@ from inference import InferencePipeline from inference.core.interfaces.camera.entities import VideoFrame from ultralytics import YOLO +from utils.general import find_in_list, load_zones_config +from utils.timers import ClockBasedTimer import supervision as sv -from utils.general import load_zones_config, find_in_list -from utils.timers import ClockBasedTimer COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"]) COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS) @@ -91,7 +91,6 @@ def main( iou: float, classes: List[int], ) -> None: - model = YOLO(weights) def inference_callback(frame: VideoFrame) -> sv.Detections: @@ -171,4 +170,4 @@ def inference_callback(frame: VideoFrame) -> sv.Detections: confidence=args.confidence_threshold, iou=args.iou_threshold, classes=args.classes, - ) \ No newline at end of file + ) diff --git a/examples/time_in_zone/ultralytics_stream_example.py b/examples/time_in_zone/ultralytics_stream_example.py index 52c8700df..1cc82b446 100644 --- a/examples/time_in_zone/ultralytics_stream_example.py +++ b/examples/time_in_zone/ultralytics_stream_example.py @@ -4,10 +4,10 @@ import cv2 import numpy as np from ultralytics import YOLO +from utils.general import find_in_list, get_stream_frames_generator, load_zones_config +from utils.timers import ClockBasedTimer import supervision as sv -from utils.general import load_zones_config, find_in_list, get_stream_frames_generator -from utils.timers import ClockBasedTimer COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"]) COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS) diff --git a/examples/time_in_zone/utils/timers.py b/examples/time_in_zone/utils/timers.py index f5152eaf4..cb5b471f6 100644 --- a/examples/time_in_zone/utils/timers.py +++ b/examples/time_in_zone/utils/timers.py @@ -2,6 +2,7 @@ from typing import Dict import numpy as np + import supervision as sv