Skip to content

chore(pre_commit): ⬆ pre_commit autoupdate#2248

Open
pre-commit-ci[bot] wants to merge 1 commit into
developfrom
pre-commit-ci-update-config
Open

chore(pre_commit): ⬆ pre_commit autoupdate#2248
pre-commit-ci[bot] wants to merge 1 commit into
developfrom
pre-commit-ci-update-config

Conversation

@pre-commit-ci
Copy link
Copy Markdown
Contributor

@pre-commit-ci pre-commit-ci Bot commented May 11, 2026

@pre-commit-ci pre-commit-ci Bot requested a review from SkalskiP as a code owner May 11, 2026 17:38
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 78%. Comparing base (6fb4e80) to head (d5afebb).

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #2248   +/-   ##
=======================================
  Coverage       78%     78%           
=======================================
  Files           66      66           
  Lines         8347    8347           
=======================================
  Hits          6475    6475           
  Misses        1872    1872           
πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repository’s pre-commit tooling (notably mypy) and then performs a broad set of type- and dtype-related refactors across the codebase to satisfy stricter static checking (e.g., explicit np.float32/np.int32 arrays, additional cast() usage, and CompactMask handling in metrics/utilities).

Changes:

  • Bump pre-commit hooks (pyproject-fmt, mirrors-mypy) and adjust mypy configuration (python_version = 3.10).
  • Add a local stub for the deprecate module and update deprecated-decorator usage to avoid mypy errors.
  • Normalize/clarify array dtypes and typing across detections, metrics, dataset converters, and drawing utilities (including CompactMask β†’ dense conversions in several places).

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/supervision/validators/init.py Import ordering/type-ignore cleanup for deprecated decorators.
src/supervision/utils/video.py Add typing casts and make fourcc lookup more type-checker-friendly.
src/supervision/utils/notebook.py Normalize image inputs to np.uint8 arrays for plotting helpers.
src/supervision/utils/image.py Tighten dtypes/typing around crop/resize/letterbox/overlay/grayscale utilities.
src/supervision/utils/conversion.py Adjust wrapper typings; strengthen image conversion helpers’ typing/dtypes.
src/supervision/tracker/byte_tracker/single_object_track.py Improve typing/dtypes for Kalman multi-predict inputs/outputs.
src/supervision/tracker/byte_tracker/matching.py Add casts, handle empty inputs explicitly, and normalize float32 math.
src/supervision/tracker/byte_tracker/kalman_filter.py Normalize motion covariance construction to float32 arrays.
src/supervision/tracker/byte_tracker/core.py Import reordering for deprecated_class.
src/supervision/metrics/utils/object_size.py Tighten NDArray typing with explicit Any.
src/supervision/metrics/recall.py Normalize empty-array dtypes; add CompactMask β†’ dense handling; pandas export fix.
src/supervision/metrics/precision.py Normalize empty-array dtypes; add CompactMask handling; pandas export fix.
src/supervision/metrics/mean_average_recall.py pandas export fix; normalize class arrays/dtypes; CompactMask handling.
src/supervision/metrics/mean_average_precision.py pandas export fix; add casts/dtypes for returned arrays.
src/supervision/metrics/f1_score.py Normalize empty-array dtypes; add CompactMask β†’ dense handling; pandas export fix.
src/supervision/metrics/detection.py Confusion matrix dtype normalization and plotting numeric conversions.
src/supervision/key_points/core.py Add optional-array equality helper; tighten typing for class_id/data and indexing.
src/supervision/key_points/annotators.py Normalize anchor arrays and box generation dtypes.
src/supervision/draw/utils.py Improve image loading error handling; adjust blending implementation.
src/supervision/detection/vlm.py Normalize parsing outputs’ dtypes and array construction.
src/supervision/detection/utils/polygons.py Ensure OpenCV polygon ops receive float32 arrays; simplify return typing.
src/supervision/detection/utils/masks.py Normalize centroid/CC-stats numeric types and connected-components outputs.
src/supervision/detection/utils/iou_and_nms.py Normalize np.eye dtype and broaden typing for masks grouping.
src/supervision/detection/utils/internal.py Normalize Roboflow-result parsing dtypes; generalize data/metadata typing.
src/supervision/detection/utils/converters.py Normalize converter outputs to float32/int32; simplify/adjust return typing.
src/supervision/detection/utils/boxes.py Normalize outputs to float32 and adjust typing for box utilities.
src/supervision/detection/tools/smoother.py Handle confidence=None safely when averaging tracks; normalize float32 outputs.
src/supervision/detection/tools/polygon_zone.py Minor typing cleanup; avoid redundant .astype(bool) return.
src/supervision/detection/tools/inference_slicer.py Introduce a PIL/ndarray image input alias and adjust callback typing/casts.
src/supervision/detection/line_zone.py Normalize intermediate array dtypes and remove unnecessary casts.
src/supervision/detection/core.py Tighten Detections field dtypes/typing; add helpers for optional equality and dense masks.
src/supervision/detection/compact_mask.py Minor typing/casting cleanups in iteration/sum and internal resizing.
src/supervision/dataset/utils.py Improve typing around deprecated wrappers and class-id remapping.
src/supervision/dataset/formats/yolo.py Tighten typing/dtypes for parsing/serialization and image_shape handling.
src/supervision/dataset/formats/pascal_voc.py Normalize bbox/polygon types and broaden accepted image_shape tuples.
src/supervision/dataset/formats/coco.py Tighten typing for masks/data and ensure boolean masks on export.
src/supervision/dataset/core.py Add casts for cv2.imread return type and broaden image_shape typing for exports.
src/supervision/annotators/utils.py Normalize dtype handling in snap_boxes and add explicit Trace array typings.
src/supervision/annotators/core.py Normalize mask handling for CompactMask and ensure OpenCV outputs are np.uint8.
src/deprecate/init.pyi Add local typing stub for deprecate APIs used throughout the codebase.
pyproject.toml Update mypy python_version to 3.10.
.pre-commit-config.yaml Bump pyproject-fmt and mirrors-mypy hook revisions.

Comment thread src/supervision/draw/utils.py Outdated
Comment thread src/supervision/metrics/precision.py Outdated
Comment thread src/supervision/detection/utils/converters.py Outdated
Comment thread src/supervision/detection/core.py Outdated
Comment thread pyproject.toml Outdated
@Borda Borda force-pushed the pre-commit-ci-update-config branch from a6567ba to 38f6bb8 Compare May 13, 2026 18:33
updates:
- [github.com/tox-dev/pyproject-fmt: v2.21.1 β†’ v2.21.2](tox-dev/pyproject-fmt@v2.21.1...v2.21.2)
- [github.com/astral-sh/ruff-pre-commit: v0.15.12 β†’ v0.15.13](astral-sh/ruff-pre-commit@v0.15.12...v0.15.13)
- [github.com/pre-commit/mirrors-mypy: v1.20.2 β†’ v2.1.0](pre-commit/mirrors-mypy@v1.20.2...v2.1.0)
@pre-commit-ci pre-commit-ci Bot force-pushed the pre-commit-ci-update-config branch from f682093 to d5afebb Compare May 18, 2026 17:50
@Borda Borda requested a review from Copilot May 19, 2026 12:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant