4792 Commits
Author SHA1 Message Date
Jirka Borovec cfaea751f2 Refactor metric tests with fixtures and improved structure and clarity (#2123)
* Refactor metric test files by encapsulating fixtures and improved structure and clarity
* Update `test/metrics/conftest.py` fixture values to refine test case coverage
2026-02-02 12:18:10 +01:00
6e8e6fb276 add unit tests for precision, recall and f1_score metrics (#2119)
* add unit tests for precision, recall and f1_score metrics

These 3 metrics had zero test coverage. Created comprehensive tests
covering all main scenarios like perfect matches, partial overlaps,
empty cases, multiple classes and different iou thresholds.

All tests validate results mathematically and cover edge cases.
Tests follow the existing code style and use pytest parametrize
for different averaging methods.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: jirka <6035284+Borda@users.noreply.github.com>
2026-02-02 11:40:43 +01:00
jirka 6c2c3f8862 Convert various modules' type annotations + docstring examples to align with numpy.typing & fix linting 2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 64acee9bec Convert supervision/utils/image.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 5f17003f17 Convert supervision/utils/internal.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] cda79458a9 Convert supervision/utils/iterables.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 566844f591 Convert supervision/utils/notebook.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 4c35dee692 Convert supervision/utils/file.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] e2ca285610 Convert supervision/metrics/recall.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] c999fad06f Convert supervision/metrics/precision.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] a542406945 Convert supervision/metrics/mean_average_recall.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 00a123b5fb Convert supervision/metrics/mean_average_precision.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 3d939fd4a2 Convert supervision/metrics/f1_score.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] f005ea1d17 Convert supervision/metrics/detection.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] f6326d5590 Convert supervision/key_points/core.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] b4262bb08e Convert supervision/key_points/annotators.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] a9dad95fa7 Convert supervision/geometry/utils.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 91ff090168 Convert supervision/draw/utils.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 6d68a825ab Convert supervision/draw/color.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 2043ba7feb Convert supervision/detection/utils/vlms.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 5ac08abcf3 Convert supervision/detection/utils/masks.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 1c37d143b4 Convert supervision/detection/utils/iou_and_nms.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] f78b891011 Convert supervision/detection/utils/converters.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] f2fc5b2952 Convert supervision/detection/utils/boxes.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 09565ddacd Convert supervision/detection/tools/csv_sink.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 780db7520d Convert supervision/dataset/utils.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] fd9083ae76 Convert supervision/dataset/core.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] ebe3fd4d2f Convert supervision/classification/core.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] ce4204adc1 Convert supervision/assets/downloader.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] 48450b5da3 Convert supervision/annotators/utils.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
jirkaandcopilot-swe-agent[bot] fbd6f4dc5a Convert supervision/annotators/core.py docstrings to doctests
---

Co-authored-by: copilot-swe-agent[bot] <198982749+copilot@users.noreply.github.com>
2026-02-02 18:10:37 +09:00
Kader Miyanyedi 4c1f33189b refactor(typing): Typing error has been fixed for draw and geometry files. (#2120) 2026-02-02 07:57:24 +01:00
Danielandpre-commit-ci[bot] dcce0e4807 test(detection): add adapter tests and ignore local data directory (#2116)
* test(detection): add adapter tests and ignore local data directory
* fix(pre_commit): 🎨 auto format pre-commit hooks
* chore: retrigger ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-02-02 07:56:04 +01:00
dependabot[bot] b8e88bf9c5 ⬆️ Bump astral-sh/setup-uv in the github-actions group (#2122)
Bumps the github-actions group with 1 update: [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv).


Updates `astral-sh/setup-uv` from 7.2.0 to 7.2.1
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/61cb8a9741eeb8a550a1b8544337180c0fc8476b...803947b9bd8e9f986429fa0c5a41c367cd732b41)

---
updated-dependencies:
- dependency-name: astral-sh/setup-uv
  dependency-version: 7.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-02 07:43:08 +01:00
3b09a6356a fix: process_video silent hang on callback error (#2022)
* Handle process_video worker exceptions
* test: add unit tests for process_video exception handling and fix docstring typo
* fix(pre_commit): 🎨 auto format pre-commit hooks
* Handle `Full` exception in video writer queue and add test for small buffer scenario
* Apply suggestions from code review

---------

Co-authored-by: Your Name <realh4m@users.noreply.github.com>
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: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-30 10:46:19 +01:00
5ced8c4ea0 Add unit tests for key_points - skeleton & annotators (#2099)
* Refactor key point annotator tests to use reusable fixtures for test clarity and maintainability
* Apply suggestions from code review
* fix(pre_commit): 🎨 auto format pre-commit hooks
* Move `assert_image_mostly_same` helper to a shared module and update imports in tests
* Update test/key_points/test_skeletons.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-29 18:22:19 +01:00
Jirka Borovec b25556dae9 Remove unnecessary fetch-depth parameter from CI docs (#2115) 2026-01-29 17:02:14 +01:00
Jirka Borovecandpre-commit-ci[bot] beaa0be014 Add comprehensive unittests for KeyPoints functionality (#2109)
* Add comprehensive unittests for KeyPoints functionality
* fix(pre_commit): 🎨 auto format pre-commit hooks
* Refactor and expand KeyPoints tests for improved coverage

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-29 16:50:11 +01:00
Jirka Borovecandpre-commit-ci[bot] a765bd9bd7 typing/annotators: Simplify type annotations in docstrings by removing redundant type details (#2086)
* Simplify type annotations in docstrings by removing redundant type details
* Refactor type annotations and improve type safety across annotator-related utilities and methods
* Enhance type safety by refining NumPy type annotations across annotator-related utilities and methods
* Refine type annotations by adding explicit NumPy ndarray type for `frame_id` in `put` method

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-29 16:40:30 +01:00
7bf03f5a3c typing/utils: Add annotations & enforce stricter typing (#2107)
* Update typing annotations and update type hints across utility modules
* Refine docstrings by aligning parameter descriptions with new typing annotations across utility modules
* Apply suggestions from code review
* fix(pre_commit): 🎨 auto format pre-commit hooks
* Update typing annotations and docstrings across utility modules

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-29 15:46:17 +01:00
Jirka Borovec 93d419d7c6 Enable testing doctest in the package docstrings (#2111)
* Exclude examples directory from test coverage in CI workflow
* demo * case
2026-01-29 10:08:10 +01:00
44614dea94 test: add regression test for numpy color lookup (#2110)
* test: add regression test for numpy color lookup
* fix(pre_commit): 🎨 auto format pre-commit hooks
* test: fix numpy color lookup docstring length
* Update test/annotators/test_core.py

---------

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>
2026-01-28 16:01:26 +01:00
Jirka Borovec ac379e467a Add unittests for supervision.annotators.core module (#2093)
* Add unit tests for `supervision.annotators.core` module
* Update test/annotators/test_core.py
2026-01-27 07:19:16 +01:00
7507d3a68c Add unittests for assets and downloader functionality (#2095)
* Apply suggestions from code review
* Use BASE_VIDEO_URL constant in test instead of hard-coded URL (#2097)
* Replace hard-coded URL with BASE_VIDEO_URL constant in test
* Fix non-deterministic test_invalid_asset by patching Path.exists (#2096)
* Fix test_invalid_asset to be deterministic by patching Path.exists

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-01-27 07:18:06 +01:00
Jirka Borovec 06bd638f15 Refactor test utilities: clarify module purpose and improve function's names (#2094)
* fix wrong types in test_csv and test_json
2026-01-27 07:13:18 +01:00
Jirka Borovec 5d60d78362 Standardize workflow names for consistency (#2098) 2026-01-27 07:09:56 +01:00
Jirka Borovec 377a87dbba Chore release to use GH release events for PyPI & asset publishing (#2100)
* Chore release to use GH release events for PyPI & asset publishing
* Fix PyPI publish condition to exclude prereleases
* Allow manual triggering of PyPI publish via workflow_dispatch
2026-01-27 07:02:15 +01:00
pre-commit-ci[bot] c2c7ca03d3 chore(pre_commit): ⬆ pre_commit autoupdate (#2084)
* chore(pre_commit): ⬆ pre_commit autoupdate

updates:
- [github.com/tox-dev/pyproject-fmt: v2.6.0 → v2.11.1](https://github.com/tox-dev/pyproject-fmt/compare/v2.6.0...v2.11.1)
- [github.com/astral-sh/ruff-pre-commit: v0.14.11 → v0.14.14](https://github.com/astral-sh/ruff-pre-commit/compare/v0.14.11...v0.14.14)

* fix(pre_commit): 🎨 auto format pre-commit hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-27 07:01:02 +01:00
Jirka Borovec 21482e9109 typing/assets: Add type hints to methods and polish docstrings (#2087) 2026-01-27 05:06:36 +01:00
Jirka BorovecandCopilot 0bf55b7ac7 Configure mypy in pre-commit and pyproject.toml (#2091)
* Configure mypy in pre-commit and pyproject.toml
* ignore_missing_imports=false

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-27 04:55:24 +01:00