From ad458cf7056c9ddfa74e0053cb7b3c249e13f39d Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Thu, 2 Nov 2023 20:38:17 +0300 Subject: [PATCH 01/27] =?UTF-8?q?docs:=20=F0=9F=9A=80=20hacktoberfest=2020?= =?UTF-8?q?23=20finished.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thank you all who participate to hacktoberfest to make supervision awesome ! 🎉 🎉 🎉 🎉 --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 78d8fbf04..3a95ff13e 100644 --- a/README.md +++ b/README.md @@ -24,10 +24,6 @@ - - - - ## 👋 hello **We write your reusable computer vision tools.** Whether you need to load your dataset from your hard drive, draw detections on an image or video, or count how many detections are in a zone. You can count on us! 🤝 From 899d88676bb5d9940d125e3dfbe767a693bb6e38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 00:54:42 +0000 Subject: [PATCH 02/27] :arrow_up: Bump mkdocs-material from 9.4.7 to 9.4.8 Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.4.7 to 9.4.8. - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.4.7...9.4.8) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index b438cf119..24e90ea63 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1777,13 +1777,13 @@ mkdocs = ">=1.1" [[package]] name = "mkdocs-material" -version = "9.4.7" +version = "9.4.8" description = "Documentation that simply works" optional = false python-versions = ">=3.8" files = [ - {file = "mkdocs_material-9.4.7-py3-none-any.whl", hash = "sha256:4d698d52bb6a6a3c452ab854481c4cdb68453a0420956a6aee2de55fe15fe610"}, - {file = "mkdocs_material-9.4.7.tar.gz", hash = "sha256:e704e001c9ef17291e1d3462c202425217601653e18f68f85d28eff4690e662b"}, + {file = "mkdocs_material-9.4.8-py3-none-any.whl", hash = "sha256:8b20f6851bddeef37dced903893cd176cf13a21a482e97705a103c45f06ce9b9"}, + {file = "mkdocs_material-9.4.8.tar.gz", hash = "sha256:f0c101453e8bc12b040e8b64ca39a405d950d8402609b1378cc2b98976e74b5f"}, ] [package.dependencies] From 06945856a3b2a23d5e8716a1bf037f2dcac6544e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 00:57:31 +0000 Subject: [PATCH 03/27] :arrow_up: Bump ruff from 0.1.3 to 0.1.4 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.3 to 0.1.4. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.3...v0.1.4) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 40 ++++++++++++++++++++-------------------- pyproject.toml | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/poetry.lock b/poetry.lock index b438cf119..bec3edd7e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3166,28 +3166,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.3" -description = "An extremely fast Python linter, written in Rust." +version = "0.1.4" +description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.3-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:b46d43d51f7061652eeadb426a9e3caa1e0002470229ab2fc19de8a7b0766901"}, - {file = "ruff-0.1.3-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:b8afeb9abd26b4029c72adc9921b8363374f4e7edb78385ffaa80278313a15f9"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca3cf365bf32e9ba7e6db3f48a4d3e2c446cd19ebee04f05338bc3910114528b"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4874c165f96c14a00590dcc727a04dca0cfd110334c24b039458c06cf78a672e"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eec2dd31eed114e48ea42dbffc443e9b7221976554a504767ceaee3dd38edeb8"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:dc3ec4edb3b73f21b4aa51337e16674c752f1d76a4a543af56d7d04e97769613"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e3de9ed2e39160800281848ff4670e1698037ca039bda7b9274f849258d26ce"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c595193881922cc0556a90f3af99b1c5681f0c552e7a2a189956141d8666fe8"}, - {file = "ruff-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f75e670d529aa2288cd00fc0e9b9287603d95e1536d7a7e0cafe00f75e0dd9d"}, - {file = "ruff-0.1.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:76dd49f6cd945d82d9d4a9a6622c54a994689d8d7b22fa1322983389b4892e20"}, - {file = "ruff-0.1.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:918b454bc4f8874a616f0d725590277c42949431ceb303950e87fef7a7d94cb3"}, - {file = "ruff-0.1.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d8859605e729cd5e53aa38275568dbbdb4fe882d2ea2714c5453b678dca83784"}, - {file = "ruff-0.1.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0b6c55f5ef8d9dd05b230bb6ab80bc4381ecb60ae56db0330f660ea240cb0d4a"}, - {file = "ruff-0.1.3-py3-none-win32.whl", hash = "sha256:3e7afcbdcfbe3399c34e0f6370c30f6e529193c731b885316c5a09c9e4317eef"}, - {file = "ruff-0.1.3-py3-none-win_amd64.whl", hash = "sha256:7a18df6638cec4a5bd75350639b2bb2a2366e01222825562c7346674bdceb7ea"}, - {file = "ruff-0.1.3-py3-none-win_arm64.whl", hash = "sha256:12fd53696c83a194a2db7f9a46337ce06445fb9aa7d25ea6f293cf75b21aca9f"}, - {file = "ruff-0.1.3.tar.gz", hash = "sha256:3ba6145369a151401d5db79f0a47d50e470384d0d89d0d6f7fab0b589ad07c34"}, + {file = "ruff-0.1.4-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:864958706b669cce31d629902175138ad8a069d99ca53514611521f532d91495"}, + {file = "ruff-0.1.4-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:9fdd61883bb34317c788af87f4cd75dfee3a73f5ded714b77ba928e418d6e39e"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b4eaca8c9cc39aa7f0f0d7b8fe24ecb51232d1bb620fc4441a61161be4a17539"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a9a1301dc43cbf633fb603242bccd0aaa34834750a14a4c1817e2e5c8d60de17"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78e8db8ab6f100f02e28b3d713270c857d370b8d61871d5c7d1702ae411df683"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:80fea754eaae06335784b8ea053d6eb8e9aac75359ebddd6fee0858e87c8d510"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6bc02a480d4bfffd163a723698da15d1a9aec2fced4c06f2a753f87f4ce6969c"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9862811b403063765b03e716dac0fda8fdbe78b675cd947ed5873506448acea4"}, + {file = "ruff-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58826efb8b3efbb59bb306f4b19640b7e366967a31c049d49311d9eb3a4c60cb"}, + {file = "ruff-0.1.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:fdfd453fc91d9d86d6aaa33b1bafa69d114cf7421057868f0b79104079d3e66e"}, + {file = "ruff-0.1.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e8791482d508bd0b36c76481ad3117987301b86072158bdb69d796503e1c84a8"}, + {file = "ruff-0.1.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:01206e361021426e3c1b7fba06ddcb20dbc5037d64f6841e5f2b21084dc51800"}, + {file = "ruff-0.1.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:645591a613a42cb7e5c2b667cbefd3877b21e0252b59272ba7212c3d35a5819f"}, + {file = "ruff-0.1.4-py3-none-win32.whl", hash = "sha256:99908ca2b3b85bffe7e1414275d004917d1e0dfc99d497ccd2ecd19ad115fd0d"}, + {file = "ruff-0.1.4-py3-none-win_amd64.whl", hash = "sha256:1dfd6bf8f6ad0a4ac99333f437e0ec168989adc5d837ecd38ddb2cc4a2e3db8a"}, + {file = "ruff-0.1.4-py3-none-win_arm64.whl", hash = "sha256:d98ae9ebf56444e18a3e3652b3383204748f73e247dea6caaf8b52d37e6b32da"}, + {file = "ruff-0.1.4.tar.gz", hash = "sha256:21520ecca4cc555162068d87c747b8f95e1e95f8ecfcbbe59e8dd00710586315"}, ] [[package]] @@ -3665,4 +3665,4 @@ desktop = ["opencv-python"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.12.0" -content-hash = "578a95655c3b6ac0d14d8b8f0e26829d04af60b98a0b6a2a202e440aed7da409" +content-hash = "703468d28a0c1d50be97221b930c20aee63c325f788729bed06c36dd926743eb" diff --git a/pyproject.toml b/pyproject.toml index f4ea6ef18..a672ce4f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ pytest = "^7.2.2" wheel = ">=0.40,<0.42" notebook = ">=6.5.3,<8.0.0" build = ">=0.10,<1.1" -ruff = ">=0.0.280,<0.1.4" +ruff = ">=0.0.280,<0.1.5" isort = "^5.12.0" black = "^23.7.0" mypy = "^1.4.1" From 7946f54b95223cd87bfd6e54ae133a04a7cda3aa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:37:29 +0000 Subject: [PATCH 04/27] =?UTF-8?q?chore(pre=5Fcommit):=20=E2=AC=86=20pre=5F?= =?UTF-8?q?commit=20autoupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.3 → v0.1.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.3...v0.1.4) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e264874bf..28d135aef 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,7 +70,7 @@ repos: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.3 + rev: v0.1.4 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From b89487d8e8b7f1de5b8c0abfda85c54042e3a740 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 00:46:29 +0000 Subject: [PATCH 05/27] :arrow_up: Bump black from 23.10.1 to 23.11.0 Bumps [black](https://github.com/psf/black) from 23.10.1 to 23.11.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.10.1...23.11.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/poetry.lock b/poetry.lock index fff4f4a22..8243903ec 100644 --- a/poetry.lock +++ b/poetry.lock @@ -199,29 +199,29 @@ lxml = ["lxml"] [[package]] name = "black" -version = "23.10.1" +version = "23.11.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-23.10.1-cp310-cp310-macosx_10_16_arm64.whl", hash = "sha256:ec3f8e6234c4e46ff9e16d9ae96f4ef69fa328bb4ad08198c8cee45bb1f08c69"}, - {file = "black-23.10.1-cp310-cp310-macosx_10_16_x86_64.whl", hash = "sha256:1b917a2aa020ca600483a7b340c165970b26e9029067f019e3755b56e8dd5916"}, - {file = "black-23.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c74de4c77b849e6359c6f01987e94873c707098322b91490d24296f66d067dc"}, - {file = "black-23.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:7b4d10b0f016616a0d93d24a448100adf1699712fb7a4efd0e2c32bbb219b173"}, - {file = "black-23.10.1-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:b15b75fc53a2fbcac8a87d3e20f69874d161beef13954747e053bca7a1ce53a0"}, - {file = "black-23.10.1-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:e293e4c2f4a992b980032bbd62df07c1bcff82d6964d6c9496f2cd726e246ace"}, - {file = "black-23.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d56124b7a61d092cb52cce34182a5280e160e6aff3137172a68c2c2c4b76bcb"}, - {file = "black-23.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:3f157a8945a7b2d424da3335f7ace89c14a3b0625e6593d21139c2d8214d55ce"}, - {file = "black-23.10.1-cp38-cp38-macosx_10_16_arm64.whl", hash = "sha256:cfcce6f0a384d0da692119f2d72d79ed07c7159879d0bb1bb32d2e443382bf3a"}, - {file = "black-23.10.1-cp38-cp38-macosx_10_16_x86_64.whl", hash = "sha256:33d40f5b06be80c1bbce17b173cda17994fbad096ce60eb22054da021bf933d1"}, - {file = "black-23.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:840015166dbdfbc47992871325799fd2dc0dcf9395e401ada6d88fe11498abad"}, - {file = "black-23.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:037e9b4664cafda5f025a1728c50a9e9aedb99a759c89f760bd83730e76ba884"}, - {file = "black-23.10.1-cp39-cp39-macosx_10_16_arm64.whl", hash = "sha256:7cb5936e686e782fddb1c73f8aa6f459e1ad38a6a7b0e54b403f1f05a1507ee9"}, - {file = "black-23.10.1-cp39-cp39-macosx_10_16_x86_64.whl", hash = "sha256:7670242e90dc129c539e9ca17665e39a146a761e681805c54fbd86015c7c84f7"}, - {file = "black-23.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ed45ac9a613fb52dad3b61c8dea2ec9510bf3108d4db88422bacc7d1ba1243d"}, - {file = "black-23.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:6d23d7822140e3fef190734216cefb262521789367fbdc0b3f22af6744058982"}, - {file = "black-23.10.1-py3-none-any.whl", hash = "sha256:d431e6739f727bb2e0495df64a6c7a5310758e87505f5f8cde9ff6c0f2d7e4fe"}, - {file = "black-23.10.1.tar.gz", hash = "sha256:1f8ce316753428ff68749c65a5f7844631aa18c8679dfd3ca9dc1a289979c258"}, + {file = "black-23.11.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dbea0bb8575c6b6303cc65017b46351dc5953eea5c0a59d7b7e3a2d2f433a911"}, + {file = "black-23.11.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:412f56bab20ac85927f3a959230331de5614aecda1ede14b373083f62ec24e6f"}, + {file = "black-23.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d136ef5b418c81660ad847efe0e55c58c8208b77a57a28a503a5f345ccf01394"}, + {file = "black-23.11.0-cp310-cp310-win_amd64.whl", hash = "sha256:6c1cac07e64433f646a9a838cdc00c9768b3c362805afc3fce341af0e6a9ae9f"}, + {file = "black-23.11.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cf57719e581cfd48c4efe28543fea3d139c6b6f1238b3f0102a9c73992cbb479"}, + {file = "black-23.11.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:698c1e0d5c43354ec5d6f4d914d0d553a9ada56c85415700b81dc90125aac244"}, + {file = "black-23.11.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:760415ccc20f9e8747084169110ef75d545f3b0932ee21368f63ac0fee86b221"}, + {file = "black-23.11.0-cp311-cp311-win_amd64.whl", hash = "sha256:58e5f4d08a205b11800332920e285bd25e1a75c54953e05502052738fe16b3b5"}, + {file = "black-23.11.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:45aa1d4675964946e53ab81aeec7a37613c1cb71647b5394779e6efb79d6d187"}, + {file = "black-23.11.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4c44b7211a3a0570cc097e81135faa5f261264f4dfaa22bd5ee2875a4e773bd6"}, + {file = "black-23.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a9acad1451632021ee0d146c8765782a0c3846e0e0ea46659d7c4f89d9b212b"}, + {file = "black-23.11.0-cp38-cp38-win_amd64.whl", hash = "sha256:fc7f6a44d52747e65a02558e1d807c82df1d66ffa80a601862040a43ec2e3142"}, + {file = "black-23.11.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:7f622b6822f02bfaf2a5cd31fdb7cd86fcf33dab6ced5185c35f5db98260b055"}, + {file = "black-23.11.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:250d7e60f323fcfc8ea6c800d5eba12f7967400eb6c2d21ae85ad31c204fb1f4"}, + {file = "black-23.11.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5133f5507007ba08d8b7b263c7aa0f931af5ba88a29beacc4b2dc23fcefe9c06"}, + {file = "black-23.11.0-cp39-cp39-win_amd64.whl", hash = "sha256:421f3e44aa67138ab1b9bfbc22ee3780b22fa5b291e4db8ab7eee95200726b07"}, + {file = "black-23.11.0-py3-none-any.whl", hash = "sha256:54caaa703227c6e0c87b76326d0862184729a69b73d3b7305b6288e1d830067e"}, + {file = "black-23.11.0.tar.gz", hash = "sha256:4c68855825ff432d197229846f971bc4d6666ce90492e5b02013bcaca4d9ab05"}, ] [package.dependencies] From ed41153c190ae591d51e54049759bb0162f390c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Nov 2023 00:48:59 +0000 Subject: [PATCH 06/27] :arrow_up: Bump ruff from 0.1.4 to 0.1.5 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.4...v0.1.5) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 38 +++++++++++++++++++------------------- pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/poetry.lock b/poetry.lock index fff4f4a22..bc6dd6c63 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3166,28 +3166,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.4" +version = "0.1.5" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.4-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:864958706b669cce31d629902175138ad8a069d99ca53514611521f532d91495"}, - {file = "ruff-0.1.4-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:9fdd61883bb34317c788af87f4cd75dfee3a73f5ded714b77ba928e418d6e39e"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b4eaca8c9cc39aa7f0f0d7b8fe24ecb51232d1bb620fc4441a61161be4a17539"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a9a1301dc43cbf633fb603242bccd0aaa34834750a14a4c1817e2e5c8d60de17"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78e8db8ab6f100f02e28b3d713270c857d370b8d61871d5c7d1702ae411df683"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:80fea754eaae06335784b8ea053d6eb8e9aac75359ebddd6fee0858e87c8d510"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6bc02a480d4bfffd163a723698da15d1a9aec2fced4c06f2a753f87f4ce6969c"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9862811b403063765b03e716dac0fda8fdbe78b675cd947ed5873506448acea4"}, - {file = "ruff-0.1.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:58826efb8b3efbb59bb306f4b19640b7e366967a31c049d49311d9eb3a4c60cb"}, - {file = "ruff-0.1.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:fdfd453fc91d9d86d6aaa33b1bafa69d114cf7421057868f0b79104079d3e66e"}, - {file = "ruff-0.1.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:e8791482d508bd0b36c76481ad3117987301b86072158bdb69d796503e1c84a8"}, - {file = "ruff-0.1.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:01206e361021426e3c1b7fba06ddcb20dbc5037d64f6841e5f2b21084dc51800"}, - {file = "ruff-0.1.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:645591a613a42cb7e5c2b667cbefd3877b21e0252b59272ba7212c3d35a5819f"}, - {file = "ruff-0.1.4-py3-none-win32.whl", hash = "sha256:99908ca2b3b85bffe7e1414275d004917d1e0dfc99d497ccd2ecd19ad115fd0d"}, - {file = "ruff-0.1.4-py3-none-win_amd64.whl", hash = "sha256:1dfd6bf8f6ad0a4ac99333f437e0ec168989adc5d837ecd38ddb2cc4a2e3db8a"}, - {file = "ruff-0.1.4-py3-none-win_arm64.whl", hash = "sha256:d98ae9ebf56444e18a3e3652b3383204748f73e247dea6caaf8b52d37e6b32da"}, - {file = "ruff-0.1.4.tar.gz", hash = "sha256:21520ecca4cc555162068d87c747b8f95e1e95f8ecfcbbe59e8dd00710586315"}, + {file = "ruff-0.1.5-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:32d47fc69261c21a4c48916f16ca272bf2f273eb635d91c65d5cd548bf1f3d96"}, + {file = "ruff-0.1.5-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:171276c1df6c07fa0597fb946139ced1c2978f4f0b8254f201281729981f3c17"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17ef33cd0bb7316ca65649fc748acc1406dfa4da96a3d0cde6d52f2e866c7b39"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b2c205827b3f8c13b4a432e9585750b93fd907986fe1aec62b2a02cf4401eee6"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb408e3a2ad8f6881d0f2e7ad70cddb3ed9f200eb3517a91a245bbe27101d379"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f20dc5e5905ddb407060ca27267c7174f532375c08076d1a953cf7bb016f5a24"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aafb9d2b671ed934998e881e2c0f5845a4295e84e719359c71c39a5363cccc91"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a4894dddb476597a0ba4473d72a23151b8b3b0b5f958f2cf4d3f1c572cdb7af7"}, + {file = "ruff-0.1.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a00a7ec893f665ed60008c70fe9eeb58d210e6b4d83ec6654a9904871f982a2a"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a8c11206b47f283cbda399a654fd0178d7a389e631f19f51da15cbe631480c5b"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fa29e67b3284b9a79b1a85ee66e293a94ac6b7bb068b307a8a373c3d343aa8ec"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9b97fd6da44d6cceb188147b68db69a5741fbc736465b5cea3928fdac0bc1aeb"}, + {file = "ruff-0.1.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:721f4b9d3b4161df8dc9f09aa8562e39d14e55a4dbaa451a8e55bdc9590e20f4"}, + {file = "ruff-0.1.5-py3-none-win32.whl", hash = "sha256:f80c73bba6bc69e4fdc73b3991db0b546ce641bdcd5b07210b8ad6f64c79f1ab"}, + {file = "ruff-0.1.5-py3-none-win_amd64.whl", hash = "sha256:c21fe20ee7d76206d290a76271c1af7a5096bc4c73ab9383ed2ad35f852a0087"}, + {file = "ruff-0.1.5-py3-none-win_arm64.whl", hash = "sha256:82bfcb9927e88c1ed50f49ac6c9728dab3ea451212693fe40d08d314663e412f"}, + {file = "ruff-0.1.5.tar.gz", hash = "sha256:5cbec0ef2ae1748fb194f420fb03fb2c25c3258c86129af7172ff8f198f125ab"}, ] [[package]] @@ -3665,4 +3665,4 @@ desktop = ["opencv-python"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.12.0" -content-hash = "703468d28a0c1d50be97221b930c20aee63c325f788729bed06c36dd926743eb" +content-hash = "b69d0991b98b566ecb1a0fd9b8d615750e305d1e18b1c6356798c90207db313f" diff --git a/pyproject.toml b/pyproject.toml index a672ce4f8..f06843440 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ pytest = "^7.2.2" wheel = ">=0.40,<0.42" notebook = ">=6.5.3,<8.0.0" build = ">=0.10,<1.1" -ruff = ">=0.0.280,<0.1.5" +ruff = ">=0.0.280,<0.1.6" isort = "^5.12.0" black = "^23.7.0" mypy = "^1.4.1" From f9ead5543bf09c52b4af694cf67d566c38545319 Mon Sep 17 00:00:00 2001 From: Cody Chen Date: Thu, 9 Nov 2023 20:24:11 -0800 Subject: [PATCH 07/27] Ignore empty newlines in yolo label file --- supervision/dataset/formats/yolo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index d93b04653..577e8eb54 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -79,6 +79,8 @@ def yolo_annotations_to_detections( w, h = resolution_wh for line in lines: values = line.split() + if(len(values)==0): + continue class_id.append(int(values[0])) if len(values) == 5: box = _parse_box(values=values[1:]) From 1dce43747f790551c5d22fe67a252200590ee268 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 04:41:50 +0000 Subject: [PATCH 08/27] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/dataset/formats/yolo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index 577e8eb54..11aac4fcb 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -79,7 +79,7 @@ def yolo_annotations_to_detections( w, h = resolution_wh for line in lines: values = line.split() - if(len(values)==0): + if len(values) == 0: continue class_id.append(int(values[0])) if len(values) == 5: From e416ef4c0efccb85b3aac42d5b4f3c3b6279e990 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Fri, 10 Nov 2023 10:15:08 -0800 Subject: [PATCH 09/27] Refactor import paths and improve text file reading Refactored import paths for test utility methods across multiple test files to align with a recent package restructure. Enriched 'read_txt_file' functionality in 'file.py' allowing to optionally skip empty lines, enhancing flexibility for various use-cases. Added tests for the new 'read_txt_file' behavior in a new 'test_file.py'. Renamed 'utils.py' in test package to 'test_utils.py' for better differentiation from the util package in the source code. --- supervision/dataset/formats/yolo.py | 4 +- supervision/utils/file.py | 11 ++- test/annotators/test_utils.py | 2 +- test/dataset/formats/test_pascal_voc.py | 2 +- test/dataset/test_core.py | 2 +- test/dataset/test_utils.py | 2 +- test/detection/test_core.py | 2 +- test/metrics/test_detection.py | 2 +- test/{utils.py => test_utils.py} | 0 test/utils/__init__.py | 0 test/utils/test_file.py | 95 +++++++++++++++++++++++++ 11 files changed, 110 insertions(+), 12 deletions(-) rename test/{utils.py => test_utils.py} (100%) create mode 100644 test/utils/__init__.py create mode 100644 test/utils/test_file.py diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index 11aac4fcb..254f034d6 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -79,8 +79,6 @@ def yolo_annotations_to_detections( w, h = resolution_wh for line in lines: values = line.split() - if len(values) == 0: - continue class_id.append(int(values[0])) if len(values) == 5: box = _parse_box(values=values[1:]) @@ -151,7 +149,7 @@ def load_yolo_annotations( annotations[image_path] = Detections.empty() continue - lines = read_txt_file(str(annotation_path)) + lines = read_txt_file(file_path=annotation_path, skip_empty=True) h, w, _ = image.shape resolution_wh = (w, h) diff --git a/supervision/utils/file.py b/supervision/utils/file.py index 3954f9d58..c0521236a 100644 --- a/supervision/utils/file.py +++ b/supervision/utils/file.py @@ -57,19 +57,24 @@ def list_files_with_extensions( return files_with_extensions -def read_txt_file(file_path: str) -> List[str]: +def read_txt_file(file_path: str, skip_empty: bool = False) -> List[str]: """ Read a text file and return a list of strings without newline characters. + Optionally skip empty lines. Args: file_path (str): The path to the text file. + skip_empty (bool): If True, skip lines that are empty or contain only + whitespace. Default is False. Returns: List[str]: A list of strings representing the lines in the text file. """ with open(file_path, "r") as file: - lines = file.readlines() - lines = [line.rstrip("\n") for line in lines] + if skip_empty: + lines = [line.rstrip("\n") for line in file if line.strip()] + else: + lines = [line.rstrip("\n") for line in file] return lines diff --git a/test/annotators/test_utils.py b/test/annotators/test_utils.py index 98d9be6b2..1344d2130 100644 --- a/test/annotators/test_utils.py +++ b/test/annotators/test_utils.py @@ -1,5 +1,5 @@ from contextlib import ExitStack as DoesNotRaise -from test.utils import mock_detections +from test.test_utils import mock_detections from typing import Optional import numpy as np diff --git a/test/dataset/formats/test_pascal_voc.py b/test/dataset/formats/test_pascal_voc.py index 67d26c573..042748e9f 100644 --- a/test/dataset/formats/test_pascal_voc.py +++ b/test/dataset/formats/test_pascal_voc.py @@ -1,6 +1,6 @@ import xml.etree.ElementTree as ET from contextlib import ExitStack as DoesNotRaise -from test.utils import mock_detections +from test.test_utils import mock_detections from typing import List, Optional import numpy as np diff --git a/test/dataset/test_core.py b/test/dataset/test_core.py index 72ae27f34..4a75225ca 100644 --- a/test/dataset/test_core.py +++ b/test/dataset/test_core.py @@ -1,5 +1,5 @@ from contextlib import ExitStack as DoesNotRaise -from test.utils import mock_detections +from test.test_utils import mock_detections from typing import List, Optional import numpy as np diff --git a/test/dataset/test_utils.py b/test/dataset/test_utils.py index 6d0db2e54..5ca96ca59 100644 --- a/test/dataset/test_utils.py +++ b/test/dataset/test_utils.py @@ -1,5 +1,5 @@ from contextlib import ExitStack as DoesNotRaise -from test.utils import mock_detections +from test.test_utils import mock_detections from typing import Dict, List, Optional, Tuple, TypeVar import pytest diff --git a/test/detection/test_core.py b/test/detection/test_core.py index 02595d973..9708f338d 100644 --- a/test/detection/test_core.py +++ b/test/detection/test_core.py @@ -1,5 +1,5 @@ from contextlib import ExitStack as DoesNotRaise -from test.utils import mock_detections +from test.test_utils import mock_detections from typing import List, Optional, Union import numpy as np diff --git a/test/metrics/test_detection.py b/test/metrics/test_detection.py index 796e6c81b..7cb92c46f 100644 --- a/test/metrics/test_detection.py +++ b/test/metrics/test_detection.py @@ -1,5 +1,5 @@ from contextlib import ExitStack as DoesNotRaise -from test.utils import assert_almost_equal, mock_detections +from test.test_utils import assert_almost_equal, mock_detections from typing import Optional, Union import numpy as np diff --git a/test/utils.py b/test/test_utils.py similarity index 100% rename from test/utils.py rename to test/test_utils.py diff --git a/test/utils/__init__.py b/test/utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/test/utils/test_file.py b/test/utils/test_file.py new file mode 100644 index 000000000..4780c0735 --- /dev/null +++ b/test/utils/test_file.py @@ -0,0 +1,95 @@ +from contextlib import ExitStack as DoesNotRaise +from typing import List, Optional + +import pytest +import os + +from supervision.utils.file import read_txt_file + + +FILE_1_CONTENT = """Line 1 +Line 2 +Line 3 +""" + +FILE_2_CONTENT = """ +Line 2 + +Line 4 + +""" + +FILE_3_CONTENT = """ +Line 2 + +Line 4 + +""" + + +@pytest.fixture(scope="module", autouse=True) +def setup_and_teardown_files(): + with open("file_1.txt", "w") as file: + file.write(FILE_1_CONTENT) + with open("file_2.txt", "w") as file: + file.write(FILE_2_CONTENT) + with open("file_3.txt", "w") as file: + file.write(FILE_3_CONTENT) + + yield + + os.remove("file_1.txt") + os.remove("file_2.txt") + os.remove("file_3.txt") + + +@pytest.mark.parametrize( + "file_name, skip_empty, expected_result, exception", + [ + ( + "file_1.txt", + False, + ["Line 1", "Line 2", "Line 3"], + DoesNotRaise() + ), + ( + "file_2.txt", + True, + ["Line 2", "Line 4"], + DoesNotRaise() + ), + ( + "file_2.txt", + False, + [" ", "Line 2", "", "Line 4", ""], + DoesNotRaise() + ), + ( + "file_3.txt", + True, + ["Line 2", "Line 4"], + DoesNotRaise() + ), + ( + "file_3.txt", + False, + ["", "Line 2", "", "Line 4", ""], + DoesNotRaise() + ), + ( + "file_4.txt", + True, + None, + pytest.raises(FileNotFoundError) + ) + ] +) +def test_read_txt_file( + file_name: str, + skip_empty: bool, + expected_result: Optional[List[str]], + exception: Exception +): + with exception: + result = read_txt_file(file_name, skip_empty) + assert result == expected_result From 6211139201b992b708d21d5fba610773eb216d05 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:15:38 +0000 Subject: [PATCH 10/27] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/test_file.py | 51 ++++++++--------------------------------- 1 file changed, 10 insertions(+), 41 deletions(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 4780c0735..681665c8e 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -1,18 +1,17 @@ +import os from contextlib import ExitStack as DoesNotRaise from typing import List, Optional import pytest -import os from supervision.utils.file import read_txt_file - FILE_1_CONTENT = """Line 1 Line 2 Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 @@ -46,49 +45,19 @@ def setup_and_teardown_files(): @pytest.mark.parametrize( "file_name, skip_empty, expected_result, exception", [ - ( - "file_1.txt", - False, - ["Line 1", "Line 2", "Line 3"], - DoesNotRaise() - ), - ( - "file_2.txt", - True, - ["Line 2", "Line 4"], - DoesNotRaise() - ), - ( - "file_2.txt", - False, - [" ", "Line 2", "", "Line 4", ""], - DoesNotRaise() - ), - ( - "file_3.txt", - True, - ["Line 2", "Line 4"], - DoesNotRaise() - ), - ( - "file_3.txt", - False, - ["", "Line 2", "", "Line 4", ""], - DoesNotRaise() - ), - ( - "file_4.txt", - True, - None, - pytest.raises(FileNotFoundError) - ) - ] + ("file_1.txt", False, ["Line 1", "Line 2", "Line 3"], DoesNotRaise()), + ("file_2.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), + ("file_2.txt", False, [" ", "Line 2", "", "Line 4", ""], DoesNotRaise()), + ("file_3.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), + ("file_3.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), + ("file_4.txt", True, None, pytest.raises(FileNotFoundError)), + ], ) def test_read_txt_file( file_name: str, skip_empty: bool, expected_result: Optional[List[str]], - exception: Exception + exception: Exception, ): with exception: result = read_txt_file(file_name, skip_empty) From 95f4b5c0b8be3919962f5c105dea44acfee3dccb Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Fri, 10 Nov 2023 10:25:59 -0800 Subject: [PATCH 11/27] Add linting rule exceptions for test_file.py Added linting rule exceptions for 'test/utils/test_file.py' in 'pyproject.toml'. Specifically, the 'W291' error which checks for trailing whitespace is ignored for this test file. This is necessary to test whether 'read_txt_file' function in 'test_utils.py' correctly ignores trailing whitespaces in varies test scenarios. --- pyproject.toml | 2 ++ test/utils/test_file.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f06843440..9dc69b6e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,7 @@ extend-ignore = """ per-file-ignores = """ __init__.py: F401 supervision/assets/list.py: E501 + test/utils/test_file.py: W291 """ [tool.isort] @@ -172,6 +173,7 @@ convention = "google" [tool.ruff.per-file-ignores] "__init__.py" = ["E402","F401"] "supervision/assets/list.py" = ["E501"] +"test/utils/test_file.py" = ["W291"] [tool.ruff.pylint] max-args = 20 diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 681665c8e..0d544aa92 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From 08a48a4f5d0463cd8905f26917bd2cf452fb34a4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 18:26:25 +0000 Subject: [PATCH 12/27] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/test_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 0d544aa92..681665c8e 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From 94a95110ce7d3a9a6f5f5c7ec419ac8ad79492c2 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Fri, 10 Nov 2023 21:47:40 +0300 Subject: [PATCH 13/27] =?UTF-8?q?fix:=20=F0=9F=90=9E=20pre-commit=20fix=20?= =?UTF-8?q?and=20ignore=20removed=20(not=20needed)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9dc69b6e1..f0c7ff4d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,6 @@ extend-ignore = """ per-file-ignores = """ __init__.py: F401 supervision/assets/list.py: E501 - test/utils/test_file.py: W291 """ [tool.isort] @@ -173,7 +172,7 @@ convention = "google" [tool.ruff.per-file-ignores] "__init__.py" = ["E402","F401"] "supervision/assets/list.py" = ["E501"] -"test/utils/test_file.py" = ["W291"] + [tool.ruff.pylint] max-args = 20 From e8f0ceab71ceab4d166377b117abd77d6425769a Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Fri, 10 Nov 2023 22:07:47 +0300 Subject: [PATCH 14/27] =?UTF-8?q?fix:=20=F0=9F=90=9E=20test=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- test/utils/test_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 681665c8e..300333628 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -47,7 +47,7 @@ def setup_and_teardown_files(): [ ("file_1.txt", False, ["Line 1", "Line 2", "Line 3"], DoesNotRaise()), ("file_2.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), - ("file_2.txt", False, [" ", "Line 2", "", "Line 4", ""], DoesNotRaise()), + ("file_2.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), ("file_3.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), ("file_3.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), ("file_4.txt", True, None, pytest.raises(FileNotFoundError)), From 7de7281e0e7bfef82b9f47539a9507be5ac6a600 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 00:53:30 +0000 Subject: [PATCH 15/27] :arrow_up: Bump mypy from 1.6.1 to 1.7.0 Bumps [mypy](https://github.com/python/mypy) from 1.6.1 to 1.7.0. - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.6.1...v1.7.0) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 57 +++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/poetry.lock b/poetry.lock index d28a4bb93..2fb1e252f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1870,38 +1870,38 @@ files = [ [[package]] name = "mypy" -version = "1.6.1" +version = "1.7.0" description = "Optional static typing for Python" optional = false python-versions = ">=3.8" files = [ - {file = "mypy-1.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e5012e5cc2ac628177eaac0e83d622b2dd499e28253d4107a08ecc59ede3fc2c"}, - {file = "mypy-1.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d8fbb68711905f8912e5af474ca8b78d077447d8f3918997fecbf26943ff3cbb"}, - {file = "mypy-1.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21a1ad938fee7d2d96ca666c77b7c494c3c5bd88dff792220e1afbebb2925b5e"}, - {file = "mypy-1.6.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b96ae2c1279d1065413965c607712006205a9ac541895004a1e0d4f281f2ff9f"}, - {file = "mypy-1.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:40b1844d2e8b232ed92e50a4bd11c48d2daa351f9deee6c194b83bf03e418b0c"}, - {file = "mypy-1.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:81af8adaa5e3099469e7623436881eff6b3b06db5ef75e6f5b6d4871263547e5"}, - {file = "mypy-1.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8c223fa57cb154c7eab5156856c231c3f5eace1e0bed9b32a24696b7ba3c3245"}, - {file = "mypy-1.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a8032e00ce71c3ceb93eeba63963b864bf635a18f6c0c12da6c13c450eedb183"}, - {file = "mypy-1.6.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4c46b51de523817a0045b150ed11b56f9fff55f12b9edd0f3ed35b15a2809de0"}, - {file = "mypy-1.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:19f905bcfd9e167159b3d63ecd8cb5e696151c3e59a1742e79bc3bcb540c42c7"}, - {file = "mypy-1.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:82e469518d3e9a321912955cc702d418773a2fd1e91c651280a1bda10622f02f"}, - {file = "mypy-1.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d4473c22cc296425bbbce7e9429588e76e05bc7342da359d6520b6427bf76660"}, - {file = "mypy-1.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59a0d7d24dfb26729e0a068639a6ce3500e31d6655df8557156c51c1cb874ce7"}, - {file = "mypy-1.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cfd13d47b29ed3bbaafaff7d8b21e90d827631afda134836962011acb5904b71"}, - {file = "mypy-1.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:eb4f18589d196a4cbe5290b435d135dee96567e07c2b2d43b5c4621b6501531a"}, - {file = "mypy-1.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:41697773aa0bf53ff917aa077e2cde7aa50254f28750f9b88884acea38a16169"}, - {file = "mypy-1.6.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7274b0c57737bd3476d2229c6389b2ec9eefeb090bbaf77777e9d6b1b5a9d143"}, - {file = "mypy-1.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bbaf4662e498c8c2e352da5f5bca5ab29d378895fa2d980630656178bd607c46"}, - {file = "mypy-1.6.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:bb8ccb4724f7d8601938571bf3f24da0da791fe2db7be3d9e79849cb64e0ae85"}, - {file = "mypy-1.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:68351911e85145f582b5aa6cd9ad666c8958bcae897a1bfda8f4940472463c45"}, - {file = "mypy-1.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:49ae115da099dcc0922a7a895c1eec82c1518109ea5c162ed50e3b3594c71208"}, - {file = "mypy-1.6.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8b27958f8c76bed8edaa63da0739d76e4e9ad4ed325c814f9b3851425582a3cd"}, - {file = "mypy-1.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:925cd6a3b7b55dfba252b7c4561892311c5358c6b5a601847015a1ad4eb7d332"}, - {file = "mypy-1.6.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8f57e6b6927a49550da3d122f0cb983d400f843a8a82e65b3b380d3d7259468f"}, - {file = "mypy-1.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:a43ef1c8ddfdb9575691720b6352761f3f53d85f1b57d7745701041053deff30"}, - {file = "mypy-1.6.1-py3-none-any.whl", hash = "sha256:4cbe68ef919c28ea561165206a2dcb68591c50f3bcf777932323bc208d949cf1"}, - {file = "mypy-1.6.1.tar.gz", hash = "sha256:4d01c00d09a0be62a4ca3f933e315455bde83f37f892ba4b08ce92f3cf44bcc1"}, + {file = "mypy-1.7.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5da84d7bf257fd8f66b4f759a904fd2c5a765f70d8b52dde62b521972a0a2357"}, + {file = "mypy-1.7.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a3637c03f4025f6405737570d6cbfa4f1400eb3c649317634d273687a09ffc2f"}, + {file = "mypy-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b633f188fc5ae1b6edca39dae566974d7ef4e9aaaae00bc36efe1f855e5173ac"}, + {file = "mypy-1.7.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d6ed9a3997b90c6f891138e3f83fb8f475c74db4ccaa942a1c7bf99e83a989a1"}, + {file = "mypy-1.7.0-cp310-cp310-win_amd64.whl", hash = "sha256:1fe46e96ae319df21359c8db77e1aecac8e5949da4773c0274c0ef3d8d1268a9"}, + {file = "mypy-1.7.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:df67fbeb666ee8828f675fee724cc2cbd2e4828cc3df56703e02fe6a421b7401"}, + {file = "mypy-1.7.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a79cdc12a02eb526d808a32a934c6fe6df07b05f3573d210e41808020aed8b5d"}, + {file = "mypy-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f65f385a6f43211effe8c682e8ec3f55d79391f70a201575def73d08db68ead1"}, + {file = "mypy-1.7.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0e81ffd120ee24959b449b647c4b2fbfcf8acf3465e082b8d58fd6c4c2b27e46"}, + {file = "mypy-1.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:f29386804c3577c83d76520abf18cfcd7d68264c7e431c5907d250ab502658ee"}, + {file = "mypy-1.7.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:87c076c174e2c7ef8ab416c4e252d94c08cd4980a10967754f91571070bf5fbe"}, + {file = "mypy-1.7.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6cb8d5f6d0fcd9e708bb190b224089e45902cacef6f6915481806b0c77f7786d"}, + {file = "mypy-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d93e76c2256aa50d9c82a88e2f569232e9862c9982095f6d54e13509f01222fc"}, + {file = "mypy-1.7.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cddee95dea7990e2215576fae95f6b78a8c12f4c089d7e4367564704e99118d3"}, + {file = "mypy-1.7.0-cp312-cp312-win_amd64.whl", hash = "sha256:d01921dbd691c4061a3e2ecdbfbfad029410c5c2b1ee88946bf45c62c6c91210"}, + {file = "mypy-1.7.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:185cff9b9a7fec1f9f7d8352dff8a4c713b2e3eea9c6c4b5ff7f0edf46b91e41"}, + {file = "mypy-1.7.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7a7b1e399c47b18feb6f8ad4a3eef3813e28c1e871ea7d4ea5d444b2ac03c418"}, + {file = "mypy-1.7.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc9fe455ad58a20ec68599139ed1113b21f977b536a91b42bef3ffed5cce7391"}, + {file = "mypy-1.7.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d0fa29919d2e720c8dbaf07d5578f93d7b313c3e9954c8ec05b6d83da592e5d9"}, + {file = "mypy-1.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:2b53655a295c1ed1af9e96b462a736bf083adba7b314ae775563e3fb4e6795f5"}, + {file = "mypy-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c1b06b4b109e342f7dccc9efda965fc3970a604db70f8560ddfdee7ef19afb05"}, + {file = "mypy-1.7.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:bf7a2f0a6907f231d5e41adba1a82d7d88cf1f61a70335889412dec99feeb0f8"}, + {file = "mypy-1.7.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:551d4a0cdcbd1d2cccdcc7cb516bb4ae888794929f5b040bb51aae1846062901"}, + {file = "mypy-1.7.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:55d28d7963bef00c330cb6461db80b0b72afe2f3c4e2963c99517cf06454e665"}, + {file = "mypy-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:870bd1ffc8a5862e593185a4c169804f2744112b4a7c55b93eb50f48e7a77010"}, + {file = "mypy-1.7.0-py3-none-any.whl", hash = "sha256:96650d9a4c651bc2a4991cf46f100973f656d69edc7faf91844e87fe627f7e96"}, + {file = "mypy-1.7.0.tar.gz", hash = "sha256:1e280b5697202efa698372d2f39e9a6713a0395a756b1c6bd48995f8d72690dc"}, ] [package.dependencies] @@ -1912,6 +1912,7 @@ typing-extensions = ">=4.1.0" [package.extras] dmypy = ["psutil (>=4.0)"] install-types = ["pip"] +mypyc = ["setuptools (>=50)"] reports = ["lxml"] [[package]] From dd39360221c680d89208ec3754906db8362898f5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:46:54 +0000 Subject: [PATCH 16/27] =?UTF-8?q?chore(pre=5Fcommit):=20=E2=AC=86=20pre=5F?= =?UTF-8?q?commit=20autoupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.1 → 23.11.0](https://github.com/psf/black/compare/23.10.1...23.11.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.4...v0.1.5) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28d135aef..22589884e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -65,12 +65,12 @@ repos: - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.5 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] From 7f081f43144d1a492b6143bb1aab70b0b528703d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Nov 2023 00:36:36 +0000 Subject: [PATCH 17/27] :arrow_up: Bump actions/github-script from 6 to 7 Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/github-script dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/clear-cache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clear-cache.yml b/.github/workflows/clear-cache.yml index 76aed5cfd..5b96de427 100644 --- a/.github/workflows/clear-cache.yml +++ b/.github/workflows/clear-cache.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clear cache - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | console.log("About to clear") From 6ad1f701dd70ca924b5e350be2d96f3db4c97c51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 00:32:33 +0000 Subject: [PATCH 18/27] :arrow_up: Bump mkdocstrings from 0.23.0 to 0.24.0 Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.23.0 to 0.24.0. - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/0.23.0...0.24.0) --- updated-dependencies: - dependency-name: mkdocstrings dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 12 +++++++----- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index d28a4bb93..e9a251da1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1817,23 +1817,25 @@ files = [ [[package]] name = "mkdocstrings" -version = "0.23.0" +version = "0.24.0" description = "Automatic documentation from sources, for MkDocs." optional = false python-versions = ">=3.8" files = [ - {file = "mkdocstrings-0.23.0-py3-none-any.whl", hash = "sha256:051fa4014dfcd9ed90254ae91de2dbb4f24e166347dae7be9a997fe16316c65e"}, - {file = "mkdocstrings-0.23.0.tar.gz", hash = "sha256:d9c6a37ffbe7c14a7a54ef1258c70b8d394e6a33a1c80832bce40b9567138d1c"}, + {file = "mkdocstrings-0.24.0-py3-none-any.whl", hash = "sha256:f4908560c10f587326d8f5165d1908817b2e280bbf707607f601c996366a2264"}, + {file = "mkdocstrings-0.24.0.tar.gz", hash = "sha256:222b1165be41257b494a9d29b14135d2b7ca43f38161d5b10caae03b87bd4f7e"}, ] [package.dependencies] +click = ">=7.0" importlib-metadata = {version = ">=4.6", markers = "python_version < \"3.10\""} Jinja2 = ">=2.11.1" Markdown = ">=3.3" MarkupSafe = ">=1.1" -mkdocs = ">=1.2" +mkdocs = ">=1.4" mkdocs-autorefs = ">=0.3.1" mkdocstrings-python = {version = ">=0.5.2", optional = true, markers = "extra == \"python\""} +platformdirs = ">=2.2.0" pymdown-extensions = ">=6.3" typing-extensions = {version = ">=4.1", markers = "python_version < \"3.10\""} @@ -3665,4 +3667,4 @@ desktop = ["opencv-python"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<3.12.0" -content-hash = "b69d0991b98b566ecb1a0fd9b8d615750e305d1e18b1c6356798c90207db313f" +content-hash = "f2d0f1827c652b0ae160a093050bca163b13f2d166968893a0c5a02d27bfb856" diff --git a/pyproject.toml b/pyproject.toml index f06843440..c597daeb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,7 +67,7 @@ flake8 = { version = "*", python = ">=3.8.1,<3.12.0" } [tool.poetry.group.docs.dependencies] mkdocs-material = "^9.1.4" -mkdocstrings = {extras = ["python"], version = ">=0.20,<0.24"} +mkdocstrings = {extras = ["python"], version = ">=0.20,<0.25"} [tool.flake8] exclude = ".venv" From c28aa5aebda953b55c9d282098f0e2c9c9778425 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 14:37:02 +0100 Subject: [PATCH 19/27] Updated tests to reflect changes in file content handling --- test/utils/test_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 300333628..0d544aa92 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 @@ -47,7 +47,7 @@ def setup_and_teardown_files(): [ ("file_1.txt", False, ["Line 1", "Line 2", "Line 3"], DoesNotRaise()), ("file_2.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), - ("file_2.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), + ("file_2.txt", False, [" ", "Line 2", "", "Line 4", ""], DoesNotRaise()), ("file_3.txt", True, ["Line 2", "Line 4"], DoesNotRaise()), ("file_3.txt", False, ["", "Line 2", "", "Line 4", ""], DoesNotRaise()), ("file_4.txt", True, None, pytest.raises(FileNotFoundError)), From fcfb57612fb9fdde140af842a7b1994277030834 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:37:50 +0000 Subject: [PATCH 20/27] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/test_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 0d544aa92..681665c8e 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From d3fb4ad9321d1f316614bd668e3c277766e1d653 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 14:41:38 +0100 Subject: [PATCH 21/27] Ignoring W291 for test_file.py --- pyproject.toml | 2 ++ test/utils/test_file.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f0c7ff4d7..57a586ba8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,7 @@ extend-ignore = """ per-file-ignores = """ __init__.py: F401 supervision/assets/list.py: E501 + test/utils/test_file.py: W291 """ [tool.isort] @@ -172,6 +173,7 @@ convention = "google" [tool.ruff.per-file-ignores] "__init__.py" = ["E402","F401"] "supervision/assets/list.py" = ["E501"] +"test/utils/test_file.py" = ["W291"] [tool.ruff.pylint] diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 681665c8e..0d544aa92 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From 8025b468a277b508d8ae395df87597096c49d2ec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 13:42:25 +0000 Subject: [PATCH 22/27] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/utils/test_file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 0d544aa92..681665c8e 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,7 +11,7 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 From b9573605c735cb08b2fe538ef9dfee4d6cb47c4b Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 15 Nov 2023 17:01:57 +0300 Subject: [PATCH 23/27] =?UTF-8?q?fix(test):=20=F0=9F=A7=AA=20pre-commit's?= =?UTF-8?q?=20whitespace=20exclude=20and=20test=20case=20fix=20for=20whies?= =?UTF-8?q?pace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- .pre-commit-config.yaml | 1 + pyproject.toml | 2 -- test/utils/test_file.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 28d135aef..4ae65d645 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ repos: hooks: - id: end-of-file-fixer - id: trailing-whitespace + exclude: test/.*\.py - id: check-yaml - id: check-docstring-first - id: check-executables-have-shebangs diff --git a/pyproject.toml b/pyproject.toml index 57a586ba8..f0c7ff4d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,6 @@ extend-ignore = """ per-file-ignores = """ __init__.py: F401 supervision/assets/list.py: E501 - test/utils/test_file.py: W291 """ [tool.isort] @@ -173,7 +172,6 @@ convention = "google" [tool.ruff.per-file-ignores] "__init__.py" = ["E402","F401"] "supervision/assets/list.py" = ["E501"] -"test/utils/test_file.py" = ["W291"] [tool.ruff.pylint] diff --git a/test/utils/test_file.py b/test/utils/test_file.py index 681665c8e..7a8dd37f4 100644 --- a/test/utils/test_file.py +++ b/test/utils/test_file.py @@ -11,12 +11,12 @@ Line 3 """ -FILE_2_CONTENT = """ +FILE_2_CONTENT = """ Line 2 Line 4 -""" +""" # noqa FILE_3_CONTENT = """ Line 2 From e40532cf3ef7ce90a1e6549ad716188df41f9c2c Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 17:09:27 +0100 Subject: [PATCH 24/27] Add PolygonAnnotator and update documentation Implemented the PolygonAnnotator class in the core.py file under the supervision/annotators directory to support drawing polygons over detected objects. This was done by dividing the masks into multiple polygons and drawing them on the image. --- docs/annotators.md | 4 ++ supervision/annotators/core.py | 116 +++++++++++++++++++++++++++++---- 2 files changed, 106 insertions(+), 14 deletions(-) diff --git a/docs/annotators.md b/docs/annotators.md index efb77d11d..7689845a1 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -304,6 +304,10 @@ :::supervision.annotators.core.MaskAnnotator +## PolygonAnnotator + +:::supervision.annotators.core.PolygonAnnotator + ## LabelAnnotator :::supervision.annotators.core.LabelAnnotator diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index bd5181abf..7d2ab280b 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -7,8 +7,9 @@ from supervision.annotators.base import BaseAnnotator from supervision.annotators.utils import ColorLookup, Trace, resolve_color from supervision.detection.core import Detections -from supervision.detection.utils import clip_boxes +from supervision.detection.utils import clip_boxes, mask_to_polygons from supervision.draw.color import Color, ColorPalette +from supervision.draw.utils import draw_polygon from supervision.geometry.core import Position @@ -51,7 +52,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -93,6 +94,10 @@ def annotate( class MaskAnnotator(BaseAnnotator): """ A class for drawing masks on an image using provided detections. + + !!! warning + + This annotator utilizes the `sv.Detections.mask`. """ def __init__( @@ -129,7 +134,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -170,6 +175,89 @@ def annotate( return scene +class PolygonAnnotator(BaseAnnotator): + """ + A class for drawing polygons on an image using provided detections. + + !!! warning + + This annotator utilizes the `sv.Detections.mask`. + """ + + def __init__( + self, + color: Union[Color, ColorPalette] = ColorPalette.default(), + thickness: int = 2, + color_lookup: ColorLookup = ColorLookup.CLASS, + ): + """ + Args: + color (Union[Color, ColorPalette]): The color or color palette to use for + annotating detections. + thickness (int): Thickness of the polygon lines. + color_lookup (str): Strategy for mapping colors to annotations. + Options are `INDEX`, `CLASS`, `TRACE`. + """ + self.color: Union[Color, ColorPalette] = color + self.thickness: int = thickness + self.color_lookup: ColorLookup = color_lookup + + def annotate( + self, + scene: np.ndarray, + detections: Detections, + custom_color_lookup: Optional[np.ndarray] = None + ) -> np.ndarray: + """ + Annotates the given scene with polygons based on the provided detections. + + Args: + scene (np.ndarray): The image where polygons will be drawn. + detections (Detections): Object detections to annotate. + custom_color_lookup (Optional[np.ndarray]): Custom color lookup array. + Allows to override the default color mapping strategy. + + Returns: + The annotated image. + + Example: + ```python + >>> import supervision as sv + + >>> image = ... + >>> detections = sv.Detections(...) + + >>> polygon_annotator = sv.PolygonAnnotator() + >>> annotated_frame = polygon_annotator.annotate( + ... scene=image.copy(), + ... detections=detections + ... ) + ``` + """ + if detections.mask is None: + return scene + + for detection_idx in range(len(detections)): + mask = detections.mask[detection_idx] + color = resolve_color( + color=self.color, + detections=detections, + detection_idx=detection_idx, + color_lookup=self.color_lookup + if custom_color_lookup is None + else custom_color_lookup, + ) + for polygon in mask_to_polygons(mask=mask): + scene = draw_polygon( + scene=scene, + polygon=polygon, + color=color, + thickness=self.thickness, + ) + + return scene + + class BoxMaskAnnotator(BaseAnnotator): """ A class for drawing box masks on an image using provided detections. @@ -209,7 +297,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -295,7 +383,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -389,7 +477,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -476,7 +564,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -560,7 +648,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -646,7 +734,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -776,7 +864,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -873,7 +961,7 @@ def annotate( detections (Detections): Object detections to annotate. Returns: - np.ndarray: The annotated image. + The annotated image. Example: ```python @@ -911,7 +999,7 @@ class TraceAnnotator: !!! warning - This annotator utilizes the `tracker_id`. Read + This annotator utilizes the `sv.Detections.tracker_id`. Read [here](https://supervision.roboflow.com/trackers/) to learn how to plug tracking into your inference pipeline. """ @@ -959,7 +1047,7 @@ def annotate( Allows to override the default color mapping strategy. Returns: - np.ndarray: The image with the trace paths drawn on it. + The annotated image. Example: ```python @@ -1055,7 +1143,7 @@ def annotate(self, scene: np.ndarray, detections: Detections) -> np.ndarray: detections (Detections): Object detections to annotate. Returns: - np.ndarray: Annotated image. + Annotated image. Example: ```python From 777e8d3e5b9cb1c4e30cd0e981713828db264f60 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:11:10 +0000 Subject: [PATCH 25/27] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto?= =?UTF-8?q?=20format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/annotators/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 7d2ab280b..2ee1f9680 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -206,7 +206,7 @@ def annotate( self, scene: np.ndarray, detections: Detections, - custom_color_lookup: Optional[np.ndarray] = None + custom_color_lookup: Optional[np.ndarray] = None, ) -> np.ndarray: """ Annotates the given scene with polygons based on the provided detections. From c1beb0f5fdb0fd08d4b86179d9f2042daf5b6942 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 17:30:06 +0100 Subject: [PATCH 26/27] Add PolygonAnnotator to supervision annotators --- supervision/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/supervision/__init__.py b/supervision/__init__.py index f4e70eadc..44f25f7f1 100644 --- a/supervision/__init__.py +++ b/supervision/__init__.py @@ -18,6 +18,7 @@ HeatMapAnnotator, LabelAnnotator, MaskAnnotator, + PolygonAnnotator, TraceAnnotator, ) from supervision.annotators.utils import ColorLookup From 2ed4e16ab5de8c7e5a10c24c416c41530d53a5a3 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 15 Nov 2023 17:49:17 +0100 Subject: [PATCH 27/27] Added a visual and code example for `PolygonAnnotator` in `supervision/annotators/core.py` and `docs/annotators.md`. --- docs/annotators.md | 21 +++++++++++++++++++++ supervision/annotators/core.py | 7 +++++++ 2 files changed, 28 insertions(+) diff --git a/docs/annotators.md b/docs/annotators.md index 7689845a1..7dd8124d6 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -166,6 +166,27 @@ +=== "Polygon" + + ```python + >>> import supervision as sv + + >>> image = ... + >>> detections = sv.Detections(...) + + >>> polygon_annotator = sv.PolygonAnnotator() + >>> annotated_frame = polygon_annotator.annotate( + ... scene=image.copy(), + ... detections=detections + ... ) + ``` + +
+ + ![polygon-annotator-example](https://media.roboflow.com/supervision-annotator-examples/polygon-annotator-example-purple.png){ align=center width="800" } + +
+ === "Label" ```python diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 2ee1f9680..0e34cc16c 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -233,6 +233,9 @@ def annotate( ... detections=detections ... ) ``` + + ![polygon-annotator-example](https://media.roboflow.com/ + supervision-annotator-examples/polygon-annotator-example-purple.png) """ if detections.mask is None: return scene @@ -343,6 +346,10 @@ def annotate( class HaloAnnotator(BaseAnnotator): """ A class for drawing Halos on an image using provided detections. + + !!! warning + + This annotator utilizes the `sv.Detections.mask`. """ def __init__(