From 28dfc39c02b96ac92102bd8db3de40b0dffeba66 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 17:21:58 +0100 Subject: [PATCH] =?UTF-8?q?chore(pre=5Fcommit):=20=E2=AC=86=20pre=5Fcommit?= =?UTF-8?q?=20autoupdate=20(#1928)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(pre_commit): ⬆ pre_commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/PyCQA/bandit: 1.8.6 → 1.9.2](https://github.com/PyCQA/bandit/compare/1.8.6...1.9.2) - [github.com/astral-sh/ruff-pre-commit: v0.12.5 → v0.14.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.5...v0.14.10) - [github.com/asottile/pyupgrade: v3.20.0 → v3.21.2](https://github.com/asottile/pyupgrade/compare/v3.20.0...v3.21.2) * linting --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> Co-authored-by: jirka --- .pre-commit-config.yaml | 10 +++++----- supervision/annotators/core.py | 6 +++--- supervision/detection/utils/masks.py | 2 +- supervision/tracker/byte_tracker/core.py | 2 +- supervision/utils/notebook.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87528b7e..bee24198 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace exclude: test/.*\.py @@ -25,17 +25,17 @@ repos: - id: mixed-line-ending - repo: https://github.com/PyCQA/bandit - rev: '1.8.6' + rev: '1.9.2' hooks: - id: bandit args: ["-c", "pyproject.toml"] additional_dependencies: ["bandit[toml]"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.5 + rev: v0.14.10 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: [--fix] - id: ruff-format types_or: [ python, pyi, jupyter ] @@ -55,7 +55,7 @@ repos: - tomli - repo: https://github.com/asottile/pyupgrade - rev: v3.20.0 + rev: v3.21.2 hooks: - id: pyupgrade args: ["--py310-plus"] diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 900d823b..26762e08 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -764,7 +764,7 @@ class EllipseAnnotator(BaseAnnotator): """ assert isinstance(scene, np.ndarray) for detection_idx in range(len(detections)): - x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) + x1, _y1, x2, y2 = detections.xyxy[detection_idx].astype(int) color = resolve_color( color=self.color, detections=detections, @@ -1621,7 +1621,7 @@ class RichLabelAnnotator(_BaseLabelAnnotator): ) # Move to the next line position - left, top, right, bottom = draw.textbbox((0, 0), line, font=self.font) + _left, top, _right, bottom = draw.textbbox((0, 0), line, font=self.font) line_height = bottom - top y_position += line_height + self.text_padding @@ -1917,7 +1917,7 @@ class TraceAnnotator(BaseAnnotator): if len(xy) > 3 and self.smooth: x, y = xy[:, 0], xy[:, 1] - tck, u = splprep([x, y], s=20) + tck, _u = splprep([x, y], s=20) x_new, y_new = splev(np.linspace(0, 1, 100), tck) spline_points = np.stack([x_new, y_new], axis=1).astype(np.int32) diff --git a/supervision/detection/utils/masks.py b/supervision/detection/utils/masks.py index 04502dba..8d409ece 100644 --- a/supervision/detection/utils/masks.py +++ b/supervision/detection/utils/masks.py @@ -100,7 +100,7 @@ def calculate_masks_centroids(masks: np.ndarray) -> np.ndarray: A 2D NumPy array of shape (num_masks, 2), where each row contains the x and y coordinates (in that order) of the centroid of the corresponding mask. """ - num_masks, height, width = masks.shape + _num_masks, height, width = masks.shape total_pixels = masks.sum(axis=(1, 2)) # offset for 1-based indexing diff --git a/supervision/tracker/byte_tracker/core.py b/supervision/tracker/byte_tracker/core.py index 9c75299e..482d33e3 100644 --- a/supervision/tracker/byte_tracker/core.py +++ b/supervision/tracker/byte_tracker/core.py @@ -247,7 +247,7 @@ class ByteTrack: if strack_pool[i].state == TrackState.Tracked ] dists = matching.iou_distance(r_tracked_stracks, detections_second) - matches, u_track, u_detection_second = matching.linear_assignment( + matches, u_track, _u_detection_second = matching.linear_assignment( dists, thresh=0.5 ) for itracked, idet in matches: diff --git a/supervision/utils/notebook.py b/supervision/utils/notebook.py index 3af09ebb..9c95a432 100644 --- a/supervision/utils/notebook.py +++ b/supervision/utils/notebook.py @@ -98,7 +98,7 @@ def plot_images_grid( " or reduce the number of images." ) - fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=size) + _fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=size) for idx, ax in enumerate(axes.flat): if idx < len(images):