From fefd005c2c746fe023d8fd4c77fa3367f4738b33 Mon Sep 17 00:00:00 2001 From: Armaggheddon Date: Mon, 10 Feb 2025 20:59:45 +0100 Subject: [PATCH 1/4] perf: improved hsv color mapping in HeatMapAnnotator by 20x --- supervision/annotators/core.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index a2b2ed56..c7c41b03 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -1944,11 +1944,9 @@ class HeatMapAnnotator(BaseAnnotator): temp = temp.astype(np.uint8) if self.kernel_size is not None: temp = cv2.blur(temp, (self.kernel_size, self.kernel_size)) - hsv = np.zeros(scene.shape) + hsv = np.full(scene.shape, 255, dtype=np.uint8) hsv[..., 0] = temp - hsv[..., 1] = 255 - hsv[..., 2] = 255 - temp = cv2.cvtColor(hsv.astype(np.uint8), cv2.COLOR_HSV2BGR) + temp = cv2.cvtColor(hsv, cv2.COLOR_HSV2BGR) mask = cv2.cvtColor(self.heat_mask.astype(np.uint8), cv2.COLOR_GRAY2BGR) > 0 scene[mask] = cv2.addWeighted(temp, self.opacity, scene, 1 - self.opacity, 0)[ mask From 408a9ad0ff7501b5a1d93a6fc92ac82beb1afcde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 00:41:26 +0000 Subject: [PATCH 2/4] :arrow_up: Bump actions/create-github-app-token from 1.11.1 to 1.11.5 Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 1.11.1 to 1.11.5. - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Commits](https://github.com/actions/create-github-app-token/compare/c1a285145b9d317df6ced56c09f525b5c2b6f755...0d564482f06ca65fa9e77e2510873638c82206f2) --- updated-dependencies: - dependency-name: actions/create-github-app-token dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/publish-docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 450f3d83..fd2f5fba 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -40,7 +40,7 @@ jobs: - name: 🔑 Create GitHub App token (mkdocs) id: mkdocs_token - uses: actions/create-github-app-token@c1a285145b9d317df6ced56c09f525b5c2b6f755 # v1.11.1 + uses: actions/create-github-app-token@0d564482f06ca65fa9e77e2510873638c82206f2 # v1.11.5 with: app-id: ${{ secrets.MKDOCS_APP_ID }} private-key: ${{ secrets.MKDOCS_PEM }} From 3562bbf2ed553589670d4c3d0ef53f5bb0d6e661 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 00:41:28 +0000 Subject: [PATCH 3/4] :arrow_up: Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.12.3 to 1.12.4. - [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases) - [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.12.3...76f52bc884231f62b9a034ebfe128415bbaabdfc) --- updated-dependencies: - dependency-name: pypa/gh-action-pypi-publish dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c2a411d9..a9fe93fb 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -38,6 +38,6 @@ jobs: uv run twine check --strict dist/* - name: 🚀 Publish to PyPi - uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3 + uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 with: attestations: true From 3ba7c1b8e26c469617838ca184bff77122619098 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 00:41:32 +0000 Subject: [PATCH 4/4] :arrow_up: Bump astral-sh/setup-uv from 5.2.2 to 5.3.0 Bumps [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) from 5.2.2 to 5.3.0. - [Release notes](https://github.com/astral-sh/setup-uv/releases) - [Commits](https://github.com/astral-sh/setup-uv/compare/4db96194c378173c656ce18a155ffc14a9fc4355...1edb52594c857e2b5b13128931090f0640537287) --- updated-dependencies: - dependency-name: astral-sh/setup-uv dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/publish-docs.yml | 2 +- .github/workflows/publish-pre-release.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/publish-testpypi.yml | 2 +- .github/workflows/test-doc.yml | 2 +- .github/workflows/uv-test.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 450f3d83..ec207953 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -34,7 +34,7 @@ jobs: fetch-depth: 0 - name: 🐍 Install uv and set Python ${{ matrix.python-version }} - uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 + uses: astral-sh/setup-uv@1edb52594c857e2b5b13128931090f0640537287 # v5.3.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/publish-pre-release.yml b/.github/workflows/publish-pre-release.yml index 8d603036..ad4c7112 100644 --- a/.github/workflows/publish-pre-release.yml +++ b/.github/workflows/publish-pre-release.yml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: 🐍 Install uv and set Python version ${{ matrix.python-version }} - uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 + uses: astral-sh/setup-uv@1edb52594c857e2b5b13128931090f0640537287 # v5.3.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c2a411d9..2d78d8c2 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -27,7 +27,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: 🐍 Install uv and set Python version ${{ matrix.python-version }} - uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 + uses: astral-sh/setup-uv@1edb52594c857e2b5b13128931090f0640537287 # v5.3.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/publish-testpypi.yml b/.github/workflows/publish-testpypi.yml index 64c87156..0911374f 100644 --- a/.github/workflows/publish-testpypi.yml +++ b/.github/workflows/publish-testpypi.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: 🐍 Install uv and set Python version ${{ matrix.python-version }} - uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 + uses: astral-sh/setup-uv@1edb52594c857e2b5b13128931090f0640537287 # v5.3.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/test-doc.yml b/.github/workflows/test-doc.yml index 33953be0..6af5bd27 100644 --- a/.github/workflows/test-doc.yml +++ b/.github/workflows/test-doc.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - name: 🐍 Install uv and set Python ${{ matrix.python-version }} - uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 + uses: astral-sh/setup-uv@1edb52594c857e2b5b13128931090f0640537287 # v5.3.0 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/uv-test.yml b/.github/workflows/uv-test.yml index 9d0a0a44..927ed2ed 100644 --- a/.github/workflows/uv-test.yml +++ b/.github/workflows/uv-test.yml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: 🐍 Install uv and set Python version ${{ matrix.python-version }} - uses: astral-sh/setup-uv@4db96194c378173c656ce18a155ffc14a9fc4355 # v5.2.2 + uses: astral-sh/setup-uv@1edb52594c857e2b5b13128931090f0640537287 # v5.3.0 with: python-version: ${{ matrix.python-version }}