Compare commits

...
964 Commits
Author SHA1 Message Date
Piotr Skalski e50c761b83 Merge pull request #1258 from roboflow/develop
`supervision-0.21.0` release
2024-06-06 08:11:08 +02:00
SkalskiP 0200fd307b mark InferenceSlicer with new status 2024-06-05 18:00:54 +02:00
Piotr Skalski 6a199c5d7e Merge pull request #1260 from roboflow/final-changes-before-supervision-0.21.0-release
final changes before `supervision-0.21.0`
2024-06-05 17:55:51 +02:00
Piotr Skalski d19c44c991 Merge pull request #1261 from roboflow/docs/new-status-tags-for-0.21.0
Update "New" tags in docs, fixed typo in one heading
2024-06-05 17:55:32 +02:00
SkalskiP 2d5de66a9b code snippets updates 2024-06-05 17:53:38 +02:00
LinasKo 13b46dda67 Update "New" tags in docs, fix typo in one heading 2024-06-05 17:44:25 +02:00
SkalskiP a3f299ceb0 update docs headers 2024-06-05 17:40:39 +02:00
SkalskiP 9a42372ff6 changelog updated 2024-06-05 17:37:01 +02:00
SkalskiP 47b9ab8f96 Merge remote-tracking branch 'origin/final-changes-before-supervision-0.21.0-release' into final-changes-before-supervision-0.21.0-release 2024-06-05 16:52:27 +02:00
SkalskiP b476acc1f3 bump version from 0.21.0rc5 to 0.21.0 2024-06-05 16:52:18 +02:00
pre-commit-ci[bot] 3cee266f71 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-06-05 14:33:09 +00:00
Piotr Skalski 111d4c6c91 Merge pull request #1206 from tc360950/line-zone-unit-tests
Add LineZone unit tests
2024-06-05 16:30:20 +02:00
LinasKo a77a2ba8aa LineZone: uncomment unit tests, set expected results 2024-06-05 16:27:53 +02:00
Piotr Skalski fb9024bc75 Merge pull request #1255 from roboflow/fix/detections-merge-revert-and-filter-out-empty
Revert flexible merging, Filter out empty detections
2024-06-05 16:01:38 +02:00
LinasKo ceecb8bbd7 Cleanup: Remove print statements from tests 2024-06-05 15:42:00 +02:00
SkalskiP c28c93bd4f non-max-merging visualization + from_lmm updates 2024-06-05 15:40:28 +02:00
LinasKo ca482967c4 Add note that merge ignores empty detections 2024-06-05 12:28:09 +02:00
LinasKo 57fa637eea Move is_empty into Detections 2024-06-05 12:18:57 +02:00
Linas Kondrackis 59c5ab5252 Merge pull request #1228 from tc360950/vectorize-line-zone
Vectorize line zone
2024-06-05 10:26:23 +02:00
LinasKo c27a28235e LineZone: Remove comment 2024-06-05 10:24:25 +02:00
Onuralp SEZER cfbb6681cc Merge pull request #1257 from roboflow/dependabot/pip/pytest-8.2.2
⬆️ Bump pytest from 8.2.1 to 8.2.2
2024-06-05 10:44:46 +03:00
dependabot[bot] 24b1db9e25 ⬆️ Bump pytest from 8.2.1 to 8.2.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.1...8.2.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-05 00:43:32 +00:00
pre-commit-ci[bot] 8c92072ecd fix(pre_commit): 🎨 auto format pre-commit hooks 2024-06-04 19:07:59 +00:00
tc360950 38d442c176 PR fixes 2024-06-04 21:06:51 +02:00
Onuralp SEZER 2f09e51458 Merge pull request #1254 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-06-03 23:25:56 +03:00
pre-commit-ci[bot] 56eb8e1698 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.5 → v0.4.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.5...v0.4.7)
2024-06-03 17:47:16 +00:00
LinasKo 5bfd51fdec is_empty check that includes data
* We need to decide if this or from_inference data appended to empty Detections is correct
2024-06-03 14:01:03 +02:00
LinasKo a5d4612402 Revert Detections.merge to 0.20.0, but filter out empty detections 2024-06-03 10:43:31 +02:00
Onuralp SEZER 941b7e30aa Merge pull request #1253 from roboflow/dependabot/pip/ruff-0.4.7
⬆️ Bump ruff from 0.4.6 to 0.4.7
2024-06-03 05:16:00 +03:00
Onuralp SEZER f4f2626b44 Merge pull request #1252 from roboflow/dependabot/pip/mkdocs-git-revision-date-localized-plugin-1.2.6
⬆️ Bump mkdocs-git-revision-date-localized-plugin from 1.2.5 to 1.2.6
2024-06-03 05:15:44 +03:00
dependabot[bot] 8f198e80cd ⬆️ Bump ruff from 0.4.6 to 0.4.7
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.6 to 0.4.7.
- [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.4.6...v0.4.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 01:14:18 +00:00
dependabot[bot] 612ac6145a ⬆️ Bump mkdocs-git-revision-date-localized-plugin
Bumps [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases)
- [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.2.5...v1.2.6)

---
updated-dependencies:
- dependency-name: mkdocs-git-revision-date-localized-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 01:05:47 +00:00
LinasKo 2b5d430382 LineZone - does not work with movement to or from zones outside limits 2024-06-01 15:44:20 +02:00
LinasKo b6ff9242fc LineZone tests: add extreme coordinate test 2024-06-01 16:19:09 +03:00
LinasKo d2f169bcfa Line zone tests - replace multi detection tests 2024-06-01 15:59:46 +03:00
Linas Kondrackis 33e10ff722 Add unit tests covering most single-detection cases
* Add Colab for visuals: https://colab.research.google.com/drive/179sq8joJ-7JSYMqYNBQlMIPYEClq1PDi?usp=sharing
* Need to visualise other cases - not sure if all are necessary
2024-05-31 20:13:13 +03:00
Linas Kondrackis 883a6bed3c Merge pull request #1236 from roboflow/feat/slicer-select-nms-or-nmm
Select overlap filtering strategy
2024-05-30 14:06:00 +03:00
Linas Kondrackis f7bd7011fe OverlapFilter: Add and validate docs, rename 2024-05-30 13:45:12 +03:00
Onuralp SEZER 6193128774 Merge pull request #1245 from roboflow/dependabot/pip/requests-2.32.3
⬆️ Bump requests from 2.32.2 to 2.32.3
2024-05-30 11:49:13 +03:00
dependabot[bot] bdc10f83fe ⬆️ Bump requests from 2.32.2 to 2.32.3
Bumps [requests](https://github.com/psf/requests) from 2.32.2 to 2.32.3.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.2...v2.32.3)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-30 01:05:20 +00:00
tc360950 dc1249969f Improve variable naming 2024-05-29 18:34:35 +02:00
Linas Kondrackis 34353aac54 Add overlap handling example image :) 2024-05-29 18:39:41 +03:00
Linas Kondrackis 6ad32406af fix: change doc path for overlap_handling, add box_non_max_merge 2024-05-29 16:31:29 +03:00
Linas Kondrackis 315c4295ff Move NMS and NMM related methods from utils into overlap_handling.py 2024-05-29 16:17:20 +03:00
Linas Kondrackis 4dc001d9bf Renamed overlap strategy, added into InferenceSlicer docs page 2024-05-29 15:53:04 +03:00
Linas Kondrackis 9d60b2009f Merge pull request #1237 from roboflow/feat/get-class-member-vars
Dynamically select Detections member variables
2024-05-29 11:12:39 +03:00
Linas Kondrackis c98698d442 get_instance_variables: test dataclass fields 2024-05-29 11:08:17 +03:00
Onuralp SEZER 3bda0bfc11 Merge pull request #1241 from roboflow/dependabot/pip/ruff-0.4.6
⬆️ Bump ruff from 0.4.5 to 0.4.6
2024-05-29 04:28:02 +03:00
Onuralp SEZER 0e19c581e4 Merge pull request #1240 from roboflow/dependabot/pip/ipywidgets-8.1.3
⬆️ Bump ipywidgets from 8.1.2 to 8.1.3
2024-05-29 04:27:52 +03:00
dependabot[bot] 8fb843ec8e ⬆️ Bump ruff from 0.4.5 to 0.4.6
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.5 to 0.4.6.
- [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.4.5...v0.4.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-29 01:10:56 +00:00
dependabot[bot] ba2b60ffb4 ⬆️ Bump ipywidgets from 8.1.2 to 8.1.3
Bumps [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) from 8.1.2 to 8.1.3.
- [Release notes](https://github.com/jupyter-widgets/ipywidgets/releases)
- [Commits](https://github.com/jupyter-widgets/ipywidgets/compare/8.1.2...8.1.3)

---
updated-dependencies:
- dependency-name: ipywidgets
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-29 01:04:41 +00:00
LinasKo d59467b4f4 Add anchor check and tests to polygon zone 2024-05-28 15:12:48 +03:00
LinasKo c0486b7f94 Remove docstrings
The class names were descriptive enough
2024-05-28 14:46:55 +03:00
Linas Kondrackis f24c6f38a0 get_instance_variables only accepts instance, more tests 2024-05-28 14:09:38 +03:00
Linas Kondrackis a6c995c9a9 More tests for get_instance_variables 2024-05-28 11:14:29 +03:00
pre-commit-ci[bot] 3c3a0792f3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-28 07:42:33 +00:00
Linas Kondrackis 1d13397503 Dynamically select Detections fields, not hardcoded 2024-05-28 10:38:54 +03:00
Linas Kondrackis f0e88b1982 Select overlap filtering strategy 2024-05-28 09:52:46 +03:00
Onuralp SEZER 9bc2907c49 Merge pull request #1235 from roboflow/dependabot/pip/mkdocs-material-9.5.25
⬆️ Bump mkdocs-material from 9.5.24 to 9.5.25
2024-05-28 03:43:10 +03:00
dependabot[bot] e7dfc04fd3 ⬆️ Bump mkdocs-material from 9.5.24 to 9.5.25
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.24 to 9.5.25.
- [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.5.24...9.5.25)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-28 00:31:55 +00:00
Piotr Skalski a0d0d45890 Merge pull request #500 from mario-dg/add_nmm_to_detections
Add Non-Maximum Merging (NMM) to Detections
2024-05-27 21:34:49 +02:00
SkalskiP 4a365fb907 add LMM to __init__.py 2024-05-27 21:31:25 +02:00
Onuralp SEZER a60cfe08e2 Merge pull request #1233 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-05-27 20:50:48 +03:00
pre-commit-ci[bot] c1ebb81d47 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.4.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.4.5)
2024-05-27 17:42:51 +00:00
Linas Kondrackis 2ee9e08446 Renamed to group_overlapping_boxes 2024-05-27 16:21:40 +03:00
Linas Kondrackis 530e1d01e1 Address comments 2024-05-27 16:17:27 +03:00
tc360950 404be16126 Code reformatting 2024-05-24 18:14:18 +02:00
tc360950 72d677ad89 Merge branch 'develop' of https://github.com/tc360950/supervision into line-zone-unit-tests 2024-05-24 18:11:17 +02:00
tc360950 d6ae86e97b Merge remote-tracking branch 'origin/vectorize-line-zone' into vectorize-line-zone 2024-05-24 18:04:54 +02:00
tc360950 ed5c26527a Code reformatting 2024-05-24 18:04:43 +02:00
pre-commit-ci[bot] d23cc008f8 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-24 16:02:31 +00:00
tc360950 9d54d91791 Pull changes from develop 2024-05-24 18:02:13 +02:00
tc360950 80feb2b12f Add comments 2024-05-24 17:43:02 +02:00
tc360950 fb30bab0fd Vectorize line zone 2024-05-24 16:50:42 +02:00
tc360950 a09b6fac6f Merge remote-tracking branch 'origin/line-zone-unit-tests' into line-zone-unit-tests
# Conflicts:
#	test/detection/test_line_counter.py
2024-05-24 16:43:03 +02:00
tc360950 4e2eb0afc2 Code reformatting 2024-05-24 16:42:40 +02:00
pre-commit-ci[bot] 1a021d5792 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-24 14:40:32 +00:00
tc360950 909ae2a8ff Merge remote-tracking branch 'origin/line-zone-unit-tests' into line-zone-unit-tests 2024-05-24 16:39:43 +02:00
tc360950 7d0488efc0 Add unit tests for negative coordinates and empty anchors 2024-05-24 16:39:30 +02:00
Piotr Skalski 2723735b01 Merge pull request #1221 from roboflow/from_paligemma_support
initial commit adding support for `from_lmm` and specifically for Pal…
2024-05-24 15:09:40 +02:00
Onuralp SEZER 7757d86abc Merge pull request #1225 from roboflow/dependabot/pip/ruff-0.4.5
⬆️ Bump ruff from 0.4.4 to 0.4.5
2024-05-24 13:55:40 +03:00
Piotr Skalski f40dd38b1a Merge pull request #1214 from roboflow/fix/remove-none-tracker-id-contents-checks
tracker_id contents are never `None`
2024-05-24 09:17:47 +02:00
Piotr Skalski ad7e643c83 Merge pull request #1180 from rolson24/fix_NaN_values_in_ByteTrack
Fix Cost Matrix containing NaN Values in ByteTrack
2024-05-24 09:01:12 +02:00
Piotr Skalski eae4040b17 Merge pull request #1224 from roboflow/docs/how-to-track-rename-title
Docs: shorter title for object tracking how-to
2024-05-24 07:59:41 +02:00
dependabot[bot] 9afca17854 ⬆️ Bump ruff from 0.4.4 to 0.4.5
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.4 to 0.4.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.4.4...v0.4.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-24 00:13:26 +00:00
Linas Kondrackis 19296a73f6 ious: Replace 0-area check with nan conversion 2024-05-23 18:45:23 +03:00
Linas Kondrackis 0721bc289b Remove _set_at_index 2024-05-23 16:21:54 +03:00
pre-commit-ci[bot] db1b4737fe fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-23 13:04:11 +00:00
Linas Kondrackis 6fbca8333e Address review comments, simplify merge
* Reintroduced iou check before response - necessary for algorithm
2024-05-23 16:01:34 +03:00
pre-commit-ci[bot] ad2220bc1d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-23 07:12:19 +00:00
SkalskiP 0115ef8b7d small fix when mask is empty 2024-05-23 09:11:47 +02:00
Onuralp SEZER d4541e1469 Merge pull request #1222 from roboflow/fix/yolo-obb
fix: 🐞 yolo obb condition check set or for newer and older version
2024-05-23 01:37:08 +03:00
Linas Kondrackis c9c2dad316 Docs: shorter title for object tracking how-to 2024-05-22 23:47:45 +03:00
Onuralp SEZER e59e2822d8 Merge pull request #1223 from roboflow/docs/how-to-track-rename-title
minor docs change: rename How To - Track Objects
2024-05-22 23:32:10 +03:00
Linas Kondrackis 99854a5b66 minor docs change: rename How To - Track Objects 2024-05-22 23:14:17 +03:00
Onuralp SEZER 251185ba67 fix: 🐞 yolo obb hasstr added into condition
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-05-22 23:08:04 +03:00
Linas Kondrackis 8b4884ec9e tracker, smoother: SupervisionWarnings 2024-05-22 21:33:34 +03:00
SkalskiP 07c36c6223 make linter happy 2024-05-22 17:47:52 +02:00
pre-commit-ci[bot] bf43d6566b fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-22 14:29:23 +00:00
SkalskiP b59d17fdae Merge remote-tracking branch 'origin/from_paligemma_support' into from_paligemma_support
# Conflicts:
#	supervision/detection/lmm.py
#	test/detection/test_lmm.py
2024-05-22 16:29:04 +02:00
SkalskiP b81c5e8475 update to allow multi-word class names 2024-05-22 16:28:24 +02:00
pre-commit-ci[bot] 7eb918282c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-22 12:27:56 +00:00
SkalskiP 36a73f7d49 clean up 2024-05-22 14:26:13 +02:00
SkalskiP a2195aa378 initial commit adding support for from_lmm and specifically for PaliGemma 2024-05-22 14:24:52 +02:00
Onuralp SEZER 2bd4348e5d Merge pull request #1220 from roboflow/dependabot/pip/requests-2.32.2
⬆️ Bump requests from 2.32.1 to 2.32.2
2024-05-22 04:00:05 +03:00
dependabot[bot] 6b7861d4d1 ---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-22 00:29:25 +00:00
pre-commit-ci[bot] 8a2f5d4726 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-21 19:19:16 +00:00
tc360950 dcfa916c75 Add docstrings with test description for LineZone tests 2024-05-21 21:18:51 +02:00
pre-commit-ci[bot] 54a0422b58 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-21 19:08:36 +00:00
tc360950 089916e26f Improve variable naming in LineZone unit tests, remove redundant test for empty tracker_id 2024-05-21 21:08:18 +02:00
Piotr Skalski 1bbe03ca27 Merge pull request #1163 from emSko/1114_RLE_support_for_COCO
1114 rle support for coco
2024-05-21 13:29:16 +02:00
pre-commit-ci[bot] 5840889818 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-21 11:08:22 +00:00
SkalskiP c3855c9828 small refactor + docs improvements 2024-05-21 13:08:02 +02:00
Linas Kondrackis 40b537c0be tracker_id contents are never None 2024-05-21 13:58:20 +03:00
SkalskiP 1d43042c55 small refactor + docs improvements 2024-05-21 12:01:05 +02:00
pre-commit-ci[bot] 996b0a3af3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-21 09:43:30 +00:00
SkalskiP f2716252d5 small refactor + docs improvements 2024-05-21 11:43:09 +02:00
Linas Kondrackis b916dc547c Merge pull request #1212 from roboflow/dependabot/pip/mkdocs-material-9.5.24
⬆️ Bump mkdocs-material from 9.5.23 to 9.5.24
2024-05-21 11:31:54 +03:00
Linas Kondrackis e1be566861 Merge pull request #1211 from roboflow/dependabot/pip/requests-2.32.1
⬆️ Bump requests from 2.31.0 to 2.32.1
2024-05-21 10:21:28 +03:00
dependabot[bot] 32f773548e ---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 01:02:35 +00:00
dependabot[bot] 414d3e9afb ---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-21 01:01:12 +00:00
magda skoczen 6dbf3f61e3 fix for unit tests for test_mask_has_holes 2024-05-20 21:47:04 +02:00
pre-commit-ci[bot] ab55e81087 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-20 19:41:35 +00:00
magda_sk 7b42d8381b Merge branch 'develop' into 1114_RLE_support_for_COCO 2024-05-20 21:41:22 +02:00
magda skoczen dfac30cba7 change docu for mask_has_multiple_segments and mask_has_holes and add to global __init__.py 2024-05-20 20:45:17 +02:00
magda skoczen c26eb1a70f unit tests for test_mask_has_multiple_segments 2024-05-20 19:52:48 +02:00
magda skoczen f0fc76c8c7 Merge branch '1114_RLE_support_for_COCO' of github.com:emSko/supervision into 1114_RLE_support_for_COCO 2024-05-20 19:23:29 +02:00
magda skoczen 68f07e18f3 tests for mask_has_holes 2024-05-20 19:23:22 +02:00
pre-commit-ci[bot] 7ee84c48e0 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-20 16:56:49 +00:00
magda skoczen 179d00bead merge 2024-05-20 18:56:25 +02:00
magda skoczen 2626263ff3 move has_holes and mask_has_multiple_segments to detections utils 2024-05-20 18:54:10 +02:00
magda skoczen a40bf78bb2 coco mock method refactoring 2024-05-20 18:17:03 +02:00
tc360950 41ca70aab6 Add missing type hints and consistent variable naming 2024-05-20 17:01:46 +02:00
Linas Kondrackis 3fbce7b6bb Merge pull request #1208 from roboflow/dependabot/pip/pytest-8.2.1
⬆️ Bump pytest from 8.2.0 to 8.2.1
2024-05-20 10:23:42 +03:00
dependabot[bot] b761a5c32b ⬆️ Bump pytest from 8.2.0 to 8.2.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.2.0 to 8.2.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.2.0...8.2.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 00:53:40 +00:00
tc360950 12a455eafa Replace unnecessary generator expressions with explicit lists 2024-05-18 17:06:28 +02:00
pre-commit-ci[bot] 6c9f8302a5 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-17 14:19:52 +00:00
tc360950 da904ad2da Add LineZone unit tests 2024-05-17 16:17:31 +02:00
pre-commit-ci[bot] 8d432c78b1 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-17 09:16:59 +00:00
magda skoczen 0cd2c9d146 documentation change for as_coco 2024-05-17 11:16:37 +02:00
magda skoczen aad5e2a212 merge seg fault fix 2024-05-17 11:11:40 +02:00
Linas Kondrackis ab775d9f76 Attempt to fix SegFault
* https://github.com/opencv/opencv-python/issues/706
2024-05-17 11:45:00 +03:00
Onuralp SEZER 1779014fd9 Merge pull request #1201 from roboflow/dependabot/pip/notebook-7.2.0
⬆️ Bump notebook from 7.1.3 to 7.2.0
2024-05-17 11:41:39 +03:00
Onuralp SEZER 84d8d98619 Merge pull request #1204 from roboflow/docs/docs-incorrect-optimal-scale-entry
docs: calculate_optimal_text_scale, not calculate_optimal_font_scale
2024-05-17 11:37:51 +03:00
magda skoczen 879ae9416a test polygon mask when mask in single component and no holes 2024-05-17 10:34:53 +02:00
Linas Kondrackis 9024396f6c Add npt.NDarray[x] types, remove resolution_wh default val 2024-05-17 10:58:45 +03:00
Linas Kondrackis de5349ad6d docs: calculate_optimal_text_scale, not calculate_optimal_font_scale
* Latter does not exist
2024-05-17 09:17:38 +03:00
Linas Kondrackis d391376912 Merge pull request #1202 from roboflow/dependabot/pip/twine-5.1.0
⬆️ Bump twine from 5.0.0 to 5.1.0
2024-05-17 09:06:37 +03:00
dependabot[bot] eb84d41c61 ⬆️ Bump twine from 5.0.0 to 5.1.0
Bumps [twine](https://github.com/pypa/twine) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/5.0.0...5.1.0)

---
updated-dependencies:
- dependency-name: twine
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 01:00:50 +00:00
dependabot[bot] 0252cf210c ⬆️ Bump notebook from 7.1.3 to 7.2.0
Bumps [notebook](https://github.com/jupyter/notebook) from 7.1.3 to 7.2.0.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.1.3...@jupyter-notebook/tree@7.2.0)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-17 00:59:54 +00:00
pre-commit-ci[bot] b3b745508b fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-16 07:23:55 +00:00
magda skoczen 511f0ab9b2 check for empty mask 2024-05-16 09:23:22 +02:00
magda skoczen 3ee72e38c3 check for empty mask 2024-05-16 09:20:26 +02:00
Piotr Skalski 5acfb9531e Merge pull request #1200 from roboflow/docs/missing-return-in-slicer-callback-2
Missing return in another slicer callback
2024-05-16 09:18:37 +02:00
Linas Kondrackis 2c769e2f72 Missing return in another slicer callback 2024-05-16 10:11:03 +03:00
pre-commit-ci[bot] ce05a0c544 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-16 06:57:26 +00:00
magda skoczen 1e8ee47db2 craete copies of mask in _has_holes and _mask_has_multiple_segments 2024-05-16 08:56:58 +02:00
pre-commit-ci[bot] eefa05cf01 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-16 06:40:58 +00:00
magda skoczen d8679d9c46 automatic RLE for masks with holes or in multiple pieces 2024-05-16 08:40:28 +02:00
Onuralp SEZER 25ceb46ed4 Merge pull request #1199 from roboflow/dependabot/pip/mkdocs-material-9.5.23
⬆️ Bump mkdocs-material from 9.5.22 to 9.5.23
2024-05-16 04:16:20 +03:00
dependabot[bot] a615dfccb6 ⬆️ Bump mkdocs-material from 9.5.22 to 9.5.23
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.22 to 9.5.23.
- [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.5.22...9.5.23)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-16 00:44:29 +00:00
Onuralp SEZER 1776bf1670 Merge pull request #1116 from jeslinpjames/RichLabelAnnotator
Adds support for unicode labels with new `RichLabelAnnotator` class
2024-05-15 19:07:51 +03:00
pre-commit-ci[bot] d983177c3a fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-15 19:01:16 +03:00
Onuralp SEZER 7b259145bb Merge branch 'develop' into RichLabelAnnotator 2024-05-15 18:53:25 +03:00
Onuralp SEZER 24d1840ea1 docs: 📝 RichLabelAnnotator documentation added into docs and minor var fixes
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-05-15 18:35:36 +03:00
Linas Kondrackis f8f3647a98 Removed suprplus NMM code for 20% speedup 2024-05-15 15:32:26 +03:00
Linas Kondrackis 559ef90d83 Simplify box_non_max_merge 2024-05-15 12:14:24 +03:00
Linas Kondrackis 0e2eec08c8 Revert np.bool comparisons with is
* Ruff complains when `== True` is used
* Different behaviour with `is True`
2024-05-15 11:48:48 +03:00
Linas Kondrackis 53f345e916 Minor renaming 2024-05-15 11:35:59 +03:00
Linas Kondrackis 6c40935266 box_non_max_merge: use our functions to compute iou 2024-05-15 11:32:30 +03:00
Linas Kondrackis 145b5fe56c Rename to batch_box_non_max_merge to box_non_max_merge_batch 2024-05-15 10:46:56 +03:00
Onuralp SEZER aed9221307 Merge pull request #1198 from xaristeidou/develop
Correct sentence spacing in `annotators/utils.py`
2024-05-15 10:44:37 +03:00
pre-commit-ci[bot] f08404eb7d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-15 06:56:08 +00:00
magda skoczen aab861c2db test_coco_annotations_to_detections result matrices defined in place 2024-05-15 08:55:47 +02:00
Christoforos Aristeidou 9c0d647fdf Merge branch 'correct-spacing' into develop 2024-05-15 09:53:16 +03:00
Christoforos Aristeidou 5ef934e780 fixed sentence spacing 2024-05-15 09:51:55 +03:00
Linas Kondrackis 2d740bdcb6 fix: merge_object_detection_pair 2024-05-15 09:38:58 +03:00
Linas Kondrackis d2d50fbe46 renamed bbox -> xyxy 2024-05-15 09:26:18 +03:00
Linas Kondrackis 26bafec8f7 Test box_non_max_merge, rename threshold,to __init__ 2024-05-15 09:23:34 +03:00
Linas Kondrackis 8014e88944 Test box_non_max_merge 2024-05-14 17:42:47 +03:00
Linas Kondrackis c3b77d05c0 Rename, remove functions, unit-test & change merge_object_detection_pair 2024-05-14 17:13:33 +03:00
LinasKo 2eb0c7c242 Merge remote-tracking branch 'upstream/develop' into add_nmm_to_detections 2024-05-14 09:46:11 +03:00
Onuralp SEZER 41a08b87be Merge pull request #1193 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-05-13 21:14:50 +03:00
pre-commit-ci[bot] 2bcd81e5fd chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.3 → v0.4.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.3...v0.4.4)
2024-05-13 17:41:06 +00:00
SkalskiP 19396771f1 bump package version from 0.21.0rc4 to 0.21.0rc5 2024-05-13 15:58:22 +02:00
Onuralp SEZER f5324897a3 Merge pull request #1189 from roboflow/dependabot/pip/mkdocs-material-9.5.22
⬆️ Bump mkdocs-material from 9.5.21 to 9.5.22
2024-05-13 16:56:57 +03:00
Piotr Skalski cd8a2be04b Merge pull request #1178 from roboflow/feat/inference-slicer-segmentation
Feat/inference slicer segmentation
2024-05-13 15:55:02 +02:00
Linas Kondrackis 8901192b92 ruff 2024-05-13 16:53:06 +03:00
Linas Kondrackis a9044e4fed Merge branch 'develop' into feat/inference-slicer-segmentation 2024-05-13 16:52:50 +03:00
Linas Kondrackis 85e4c0ec65 Slicer: highlight & mask docstring 2024-05-13 16:51:59 +03:00
Linas Kondrackis 93398108ee Slier docs: remove transfomer example - has issues. 2024-05-13 16:26:35 +03:00
Piotr Skalski f41adca384 Merge pull request #1173 from roboflow/vertex_label_annotator
`VertexLabelAnnotator`
2024-05-13 15:23:51 +02:00
SkalskiP d64bb3879c Merge remote-tracking branch 'origin/vertex_label_annotator' into vertex_label_annotator 2024-05-13 15:21:35 +02:00
SkalskiP 452e1f1ea4 more VertexLabelAnnotator docs 2024-05-13 15:21:25 +02:00
Linas Kondrackis 45e5f49c5a Infrence slicer docs: fix callbacks in transfomers 2024-05-13 16:20:05 +03:00
LinasKo 4c36b39f94 Untested: Small object segmentationation 2024-05-13 15:41:43 +03:00
pre-commit-ci[bot] e13c7dc22c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-13 12:31:37 +00:00
SkalskiP 713719a582 Merge remote-tracking branch 'origin/vertex_label_annotator' into vertex_label_annotator 2024-05-13 14:31:12 +02:00
SkalskiP 051fe5178b VertexLabelAnnotator plugged into docs 2024-05-13 14:30:55 +02:00
pre-commit-ci[bot] 1ebccebf4c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-13 12:01:26 +00:00
SkalskiP f56d7a1733 changes after code review 2024-05-13 14:01:07 +02:00
LinasKo 82ab6c57cb infrenceSlicer: resolution_wh 2024-05-13 14:14:42 +03:00
pre-commit-ci[bot] cccacab621 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-13 10:25:48 +00:00
SkalskiP 59b273ba87 small refactor 2024-05-13 12:25:25 +02:00
pre-commit-ci[bot] 9a1c11218c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-13 10:06:57 +00:00
SkalskiP d21c98a4d2 docs updated; rle_to_mask and mask_to_rle added to __init__.py 2024-05-13 12:06:38 +02:00
Linas Kondrackis 816aecb51b PR comments: tuples, docs, optional 2024-05-13 11:35:23 +03:00
dependabot[bot] 3c8995758d ⬆️ Bump mkdocs-material from 9.5.21 to 9.5.22
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.21 to 9.5.22.
- [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.5.21...9.5.22)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 01:21:27 +00:00
pre-commit-ci[bot] 14b57345a7 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-12 21:31:18 +00:00
magda skoczen d292cbf80e Merge branch '1114_RLE_support_for_COCO' of github.com:emSko/supervision into 1114_RLE_support_for_COCO 2024-05-12 23:02:45 +02:00
magda skoczen 8c857dd9a6 speed up rle to mask 2024-05-12 23:02:22 +02:00
Onuralp SEZER acfabc247f Merge pull request #1185 from roboflow/dependabot/pip/ruff-0.4.4
⬆️ Bump ruff from 0.4.3 to 0.4.4
2024-05-11 23:54:29 +03:00
Onuralp SEZER 61a63c83d9 Merge pull request #1188 from roboflow/docs/missing-return-in-slicer-callback
Minor docs update: missing return in inference slicer callback
2024-05-11 21:56:13 +03:00
Linas Kondrackis 528c960587 Minor docs update: missing return in inference slicer callback 2024-05-11 13:38:59 +03:00
Linas Kondrackis 6c6171b5d5 Simpify passing of shape 2024-05-10 18:25:02 +03:00
Linas Kondrackis b8efa25e93 Merge branch 'develop' into feat/inference-slicer-segmentation 2024-05-10 17:18:07 +03:00
SkalskiP 17c8e41fb3 bump version from 0.21.0rc3 to 0.21.0rc4 2024-05-10 15:50:03 +02:00
Piotr Skalski 0c3594432c Merge pull request #1177 from roboflow/fix/detections-merge-flexibility
More flexibility in Detections.merge
2024-05-10 15:40:06 +02:00
SkalskiP a8c44cfaff ready for merge 2024-05-10 15:36:44 +02:00
pre-commit-ci[bot] 3d0c3d9182 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-10 13:08:35 +00:00
SkalskiP 2364abf481 small error message update + few more test cases for merge_data 2024-05-10 15:08:18 +02:00
pre-commit-ci[bot] 7bd92b096f fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-10 08:18:38 +00:00
magda skoczen 39477feaf6 Merge branch '1114_RLE_support_for_COCO' of github.com:emSko/supervision into 1114_RLE_support_for_COCO 2024-05-10 10:17:13 +02:00
magda skoczen e4e66f8a9a faster mask to rle 2024-05-10 10:16:34 +02:00
dependabot[bot] 3b61ee674e ⬆️ Bump ruff from 0.4.3 to 0.4.4
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.3 to 0.4.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.4.3...v0.4.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-10 00:28:34 +00:00
Linas Kondrackis 01f7eb5be6 Retain type info by not excluding empty detections 2024-05-09 18:19:51 +03:00
pre-commit-ci[bot] 4cd1fbcef9 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-09 14:15:31 +00:00
Linas Kondrackis b6a55694f2 Move type resolution logic to loop where it's used 2024-05-09 17:12:53 +03:00
Linas Kondrackis 8c58ebe30d Roll back flex-merge on data, merge when key missing 2024-05-09 17:06:51 +03:00
Piotr Skalski 77034700dd Merge pull request #767 from DrawingProcess/mmdetectionmask
Mmdetection mask
2024-05-09 13:19:00 +02:00
Linas Kondrackis 1ebbe3a8d1 Removed comments, deindented, removed unused var 2024-05-09 09:17:37 +03:00
Onuralp SEZER 617bd30c5f Merge pull request #1175 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-05-08 22:50:20 +03:00
Onuralp SEZER 2e8720f156 Merge pull request #1176 from roboflow/dependabot/pip/jinja2-3.1.4
⬆️ Bump jinja2 from 3.1.3 to 3.1.4
2024-05-08 22:49:59 +03:00
Raif Olson c47b0ce990 filter out detections with zero area. 2024-05-08 11:07:14 -04:00
Linas Kondrackis 45563dfddf InferenceSlicer: Now works with segmentation 2024-05-08 14:07:37 +03:00
pre-commit-ci[bot] 008711aac4 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-08 10:50:32 +00:00
magda skoczen 649e27323d fix the line lengths 2024-05-08 12:49:25 +02:00
pre-commit-ci[bot] 36a301e7fc fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-07 16:01:37 +00:00
magda skoczen aac1d8862a assertion for valid mask in mask_to_rle function 2024-05-07 18:01:14 +02:00
pre-commit-ci[bot] d59ec0f223 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-07 15:36:47 +00:00
magda skoczen 3618ac35ec merge 2024-05-07 17:36:26 +02:00
magda skoczen a9f821c28a Assertion error when number of pixel in RLE does not match the nuber of pixels computed as width*height 2024-05-07 17:34:13 +02:00
Linas Kondrackis 7bb94ce966 Detections.merge merges None and []
* Detections.merge is much friendlier now. If there's a None
  or an empty array, it will merge it happily rather than
  complaining that everything needs to be either None or [].
* Data merge follows suit.
2024-05-07 17:30:12 +03:00
Linas Kondrackis fb49be8197 Tests for the new merge function 2024-05-07 16:09:05 +03:00
Piotr Skalski d7b6af84e6 Update README.md
fix errors in example commands
2024-05-07 12:25:41 +02:00
Piotr Skalski d3b845fea5 Merge pull request #1172 from ManzarIMalik/develop
Update README.md
2024-05-07 12:24:35 +02:00
Piotr Skalski 330eae4411 Merge pull request #1166 from tc360950/fix-inreasing-memory-consumption-in-bytetrack
Fix ever increasing memory consumption in ByteTrack
2024-05-07 12:20:18 +02:00
pre-commit-ci[bot] 6b5dacd8e3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-06 22:22:49 +00:00
magda skoczen 88a43cc795 unit tests for rle_to_mask and mask_to_rle functions 2024-05-07 00:22:24 +02:00
pre-commit-ci[bot] a941583bb0 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-06 21:07:51 +00:00
magda skoczen 2727152465 merge with upstream 2024-05-06 23:07:27 +02:00
dependabot[bot] 4d25437459 ⬆️ Bump jinja2 from 3.1.3 to 3.1.4
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.3...3.1.4)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 20:43:41 +00:00
magda skoczen 3ade7f060a fix order caused error with mask generation in coco_annotations_to_detections 2024-05-06 22:42:26 +02:00
magda skoczen 18a790e9ea typing chanches and doc strings for rle_to_mask and mask_to_rle functions 2024-05-06 20:21:02 +02:00
pre-commit-ci[bot] 478fbd5751 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.2 → v0.4.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.2...v0.4.3)
2024-05-06 17:48:31 +00:00
pre-commit-ci[bot] 7823e0de89 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-06 16:16:39 +00:00
SkalskiP ab0882dd55 initial version of VertexLabelAnnotator 2024-05-06 18:15:05 +02:00
SkalskiP ec6864ff04 roll back new draw_rounded_rectangle implementation 2024-05-06 18:00:13 +02:00
SkalskiP 81786ff9d3 Merge remote-tracking branch 'origin/vertex_label_annotator' into vertex_label_annotator 2024-05-06 17:40:43 +02:00
SkalskiP 95c243c058 better draw_rounded_rectangle implementation 2024-05-06 17:40:33 +02:00
pre-commit-ci[bot] 204669b08c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-06 14:25:15 +00:00
Linas Kondrackis 97c407101a NMM: Move detections merge into Detections class.
* No other changes!
2024-05-06 17:24:41 +03:00
pre-commit-ci[bot] bee3252110 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-06 14:22:34 +00:00
Linas Kondrackis d7e52bee26 NMM: Add None-checks, fix area normalization, style 2024-05-06 17:22:04 +03:00
Linas Kondrackis b1598733c2 Merge remote-tracking branch 'upstream/develop' into add_nmm_to_detections 2024-05-06 17:01:04 +03:00
pre-commit-ci[bot] 5c539c3bda fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-06 13:49:24 +00:00
SkalskiP 5d38120743 added from_xyxy and as_xyxy_int_tuple methods to Rect. added draw_rounded_rectangle function. 2024-05-06 15:39:59 +02:00
Manzar Iqbal Malik aaf5df2f6a Update README.md
Aligned draw zones file name for both examples, fixed file name for ultralytics example
2024-05-06 12:15:38 +01:00
Onuralp SEZER 447ef41fc4 Merge pull request #1171 from roboflow/dependabot/pip/ruff-0.4.3
⬆️ Bump ruff from 0.4.2 to 0.4.3
2024-05-06 12:41:10 +03:00
dependabot[bot] edd944fff8 ⬆️ Bump ruff from 0.4.2 to 0.4.3
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.2 to 0.4.3.
- [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.4.2...v0.4.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 01:18:43 +00:00
Onuralp SEZER a75efbbf73 Merge pull request #1170 from roboflow/dependabot/pip/mkdocstrings-0.25.1
⬆️ Bump mkdocstrings from 0.25.0 to 0.25.1
2024-05-06 04:16:35 +03:00
Onuralp SEZER e9c8a80823 Merge pull request #1167 from roboflow/dependabot/pip/mike-2.1.1
⬆️ Bump mike from 2.1.0 to 2.1.1
2024-05-06 04:16:01 +03:00
Onuralp SEZER 0b92417948 Merge pull request #1168 from roboflow/dependabot/pip/mkdocs-material-9.5.21
⬆️ Bump mkdocs-material from 9.5.20 to 9.5.21
2024-05-06 04:15:20 +03:00
dependabot[bot] aebbd01830 ⬆️ Bump mkdocstrings from 0.25.0 to 0.25.1
Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.25.0 to 0.25.1.
- [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.25.0...0.25.1)

---
updated-dependencies:
- dependency-name: mkdocstrings
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 01:15:08 +00:00
Onuralp SEZER c3ebccabe8 Merge pull request #1169 from roboflow/dependabot/pip/jupytext-1.16.2
⬆️ Bump jupytext from 1.16.1 to 1.16.2
2024-05-06 04:14:43 +03:00
dependabot[bot] ff52352b00 ⬆️ Bump jupytext from 1.16.1 to 1.16.2
Bumps [jupytext](https://github.com/mwouts/jupytext) from 1.16.1 to 1.16.2.
- [Release notes](https://github.com/mwouts/jupytext/releases)
- [Changelog](https://github.com/mwouts/jupytext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mwouts/jupytext/compare/v1.16.1...v1.16.2)

---
updated-dependencies:
- dependency-name: jupytext
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 01:12:45 +00:00
dependabot[bot] f7d21acd3a ⬆️ Bump mkdocs-material from 9.5.20 to 9.5.21
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.20 to 9.5.21.
- [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.5.20...9.5.21)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 01:09:12 +00:00
dependabot[bot] 92d56eda15 ⬆️ Bump mike from 2.1.0 to 2.1.1
Bumps [mike](https://github.com/jimporter/mike) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/jimporter/mike/releases)
- [Changelog](https://github.com/jimporter/mike/blob/master/CHANGES.md)
- [Commits](https://github.com/jimporter/mike/compare/v2.1.0...v2.1.1)

---
updated-dependencies:
- dependency-name: mike
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-06 01:06:46 +00:00
tc360950 d37a5f90a4 Remove old tracklets from ByteTrack.removed_tracks collection 2024-05-05 17:16:05 +02:00
pre-commit-ci[bot] 869204d42d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-05 11:59:23 +00:00
magda skoczen dc1ce02860 move rle encode decode functions to dataset/utils.py 2024-05-04 10:34:08 +02:00
Onuralp SEZER 34a5b34c88 Merge pull request #1162 from roboflow/dependabot/pip/examples/speed_estimation/tqdm-4.66.3
Bump tqdm from 4.66.1 to 4.66.3 in /examples/speed_estimation
2024-05-04 01:26:51 +03:00
dependabot[bot] f72d06b05e Bump tqdm from 4.66.1 to 4.66.3 in /examples/speed_estimation
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.66.1 to 4.66.3.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.1...v4.66.3)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-03 21:51:32 +00:00
magda skoczen 4a068ff8d7 binary mask to RL encoding 2024-05-03 09:16:13 +02:00
Onuralp SEZER 044a8fac06 Merge pull request #1160 from roboflow/dependabot/pip/mike-2.1.0
⬆️ Bump mike from 2.0.0 to 2.1.0
2024-05-03 04:04:46 +03:00
Onuralp SEZER a88089ced7 Merge pull request #1159 from roboflow/dependabot/pip/tqdm-4.66.4
⬆️ Bump tqdm from 4.66.2 to 4.66.4
2024-05-03 04:03:58 +03:00
dependabot[bot] 29b0c514cf ⬆️ Bump mike from 2.0.0 to 2.1.0
Bumps [mike](https://github.com/jimporter/mike) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/jimporter/mike/releases)
- [Changelog](https://github.com/jimporter/mike/blob/master/CHANGES.md)
- [Commits](https://github.com/jimporter/mike/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: mike
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-03 00:36:24 +00:00
dependabot[bot] 7d5a0bce45 ⬆️ Bump tqdm from 4.66.2 to 4.66.4
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.66.2 to 4.66.4.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.2...v4.66.4)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-03 00:33:20 +00:00
magda skoczen 6913ecf54d 2 annotations with segmentation, one polygon one RLE 2024-05-03 01:19:01 +02:00
magda skoczen 7f114cba4c RLE decoding 2024-05-03 00:24:46 +02:00
magda skoczen cc5e72dd5b test for RLE format 2024-05-02 22:08:08 +02:00
Piotr Skalski 177ab6ad4d Merge pull request #1138 from roboflow/feat/keypoints-from-yolo-nas
Implemented `from_yolo_nas` for keypoints
2024-05-02 16:11:09 +02:00
pre-commit-ci[bot] 7e79fa3d07 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-02 13:34:14 +00:00
Linas Kondrackis 347b75935b Ruff 2024-05-02 16:31:48 +03:00
Linas Kondrackis 079008cd17 from_yolo_nas - None class_id & names if not found 2024-05-02 16:30:01 +03:00
magda skoczen e30d4a9abb add test for generating annotation with mask 2024-05-02 12:49:31 +02:00
pre-commit-ci[bot] aab3ed2ba9 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-05-01 12:23:54 +00:00
Linas Kondrackis ba30244add Remove hardcoding of class_names, class_id.
* Still hardcoded ID to -1 and name to "" if not provided - this lets us
  stick to (n,) shape.
* Found no way to add class_names to pose tracker, so used the response
  of YOLO NAS detection instead, to check what the response looks like.
2024-05-01 15:20:50 +03:00
Onuralp SEZER 55e8f16029 Merge pull request #1158 from roboflow/dependabot/pip/mkdocs-git-revision-date-localized-plugin-1.2.5
⬆️ Bump mkdocs-git-revision-date-localized-plugin from 1.2.4 to 1.2.5
2024-05-01 03:46:57 +03:00
dependabot[bot] 33e69b2da3 ⬆️ Bump mkdocs-git-revision-date-localized-plugin
Bumps [mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) from 1.2.4 to 1.2.5.
- [Release notes](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/releases)
- [Commits](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/compare/v1.2.4...v1.2.5)

---
updated-dependencies:
- dependency-name: mkdocs-git-revision-date-localized-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 00:35:55 +00:00
Piotr Skalski 9fe3170ead Merge pull request #1157 from roboflow/fix/pin_inference_version_in_exampels_to_9.17.0
pin inference version to 0.9.17
2024-04-30 16:09:07 +02:00
SkalskiP ffda94b1e5 pin inference version to 0.9.17 2024-04-30 16:06:02 +02:00
SkalskiP 7fd5d80a3b bump version from 0.21.0rc2 to 0.21.0rc3 2024-04-30 12:30:44 +02:00
Onuralp SEZER b67d9b475f Merge pull request #1155 from roboflow/dependabot/pip/nbconvert-7.16.4
⬆️ Bump nbconvert from 7.16.3 to 7.16.4
2024-04-30 13:24:17 +03:00
Onuralp SEZER d859842fa3 Merge pull request #1156 from roboflow/dependabot/pip/mkdocs-material-9.5.20
⬆️ Bump mkdocs-material from 9.5.19 to 9.5.20
2024-04-30 13:24:03 +03:00
Onuralp SEZER 131c6ffefb Merge pull request #1153 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-04-30 13:23:49 +03:00
dependabot[bot] 71fd3178cc ⬆️ Bump mkdocs-material from 9.5.19 to 9.5.20
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.19 to 9.5.20.
- [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.5.19...9.5.20)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 00:35:39 +00:00
dependabot[bot] 71919f1d6f ⬆️ Bump nbconvert from 7.16.3 to 7.16.4
Bumps [nbconvert](https://github.com/jupyter/nbconvert) from 7.16.3 to 7.16.4.
- [Release notes](https://github.com/jupyter/nbconvert/releases)
- [Changelog](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/nbconvert/compare/v7.16.3...v7.16.4)

---
updated-dependencies:
- dependency-name: nbconvert
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 00:33:04 +00:00
SkalskiP 4732b6f1d0 bump version from 0.21.0rc1 to 0.21.0rc2 2024-04-29 22:58:13 +02:00
Piotr Skalski c024b62020 Merge pull request #1154 from roboflow/fix/pin_inference_version_in_examples_to_fix_issues_related_to_braking_changes
pin inference version in examples
2024-04-29 21:50:37 +02:00
SkalskiP d4b1375db7 pin inference version 2024-04-29 21:46:07 +02:00
Piotr Skalski 71200a5942 Merge pull request #1147 from roboflow/feat/keypoints-from-inference
Add `from_inference` to KeyPoints
2024-04-29 20:40:17 +02:00
SkalskiP 66f6a86bbf add Roboflow API KEY to example 2024-04-29 20:37:56 +02:00
SkalskiP a70588284a add Roboflow API example 2024-04-29 20:36:05 +02:00
pre-commit-ci[bot] 67160c96b0 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.2)
2024-04-29 17:52:51 +00:00
LinasKo 7331577e69 keypoints, from_inference: removed class_name option 2024-04-29 13:37:37 +03:00
Onuralp SEZER 5f00d8b595 Merge pull request #1151 from roboflow/dependabot/pip/tox-4.15.0
⬆️ Bump tox from 4.14.2 to 4.15.0
2024-04-29 12:03:30 +03:00
Onuralp SEZER 88209f233d Merge pull request #1150 from roboflow/dependabot/pip/mkdocstrings-0.25.0
⬆️ Bump mkdocstrings from 0.24.3 to 0.25.0
2024-04-29 12:03:09 +03:00
Onuralp SEZER d51067164a Merge pull request #1149 from roboflow/dependabot/pip/pytest-8.2.0
⬆️ Bump pytest from 8.1.1 to 8.2.0
2024-04-29 12:02:46 +03:00
pre-commit-ci[bot] 0dd8d7dca8 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-29 06:53:36 +00:00
Linas Kondrackis 7c39d9dc8d Merge branch 'develop' into feat/keypoints-from-inference 2024-04-29 09:53:22 +03:00
Linas Kondrackis d2d69f986e from_infernece: Example suggests users find their own model
* Example incorrectly suggested yolov8s-640
* Replaced with "<POSE_MODEL_ID>" until we have a COCO human pose model
  on prod. I don't think "horse-pose/3" is helpful - the use case is
  uncommon and the training quality is poor.
2024-04-29 09:46:12 +03:00
dependabot[bot] df0b2df2f6 ⬆️ Bump tox from 4.14.2 to 4.15.0
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.2 to 4.15.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.2...4.15.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 01:25:37 +00:00
dependabot[bot] 31844c165b ⬆️ Bump mkdocstrings from 0.24.3 to 0.25.0
Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.24.3 to 0.25.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.24.3...0.25.0)

---
updated-dependencies:
- dependency-name: mkdocstrings
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 01:24:07 +00:00
dependabot[bot] c5a2f87bb9 ⬆️ Bump pytest from 8.1.1 to 8.2.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.1 to 8.2.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.1...8.2.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 01:20:56 +00:00
Piotr Skalski 6ef9ba7390 Merge pull request #1148 from roboflow/fix/code_examples_after_supervision_0.20.0_release
fix/code examples after supervision 0.20.0 release
2024-04-26 17:59:25 +02:00
SkalskiP a532670611 bump version from 0.20.0 to 0.21.0rc1 2024-04-26 17:55:34 +02:00
SkalskiP ba2d30d110 calculate_dynamic_line_thickness -> calculate_optimal_line_thickness
`calculate_dynamic_text_scale` -> `calculate_optimal_text_scale`
2024-04-26 17:36:50 +02:00
Linas Kondrackis 619da9575a pre-commit tidy-up 2024-04-26 17:55:17 +03:00
LinasKo 25bdb560eb from_inference, support direct inference results 2024-04-26 17:53:19 +03:00
Onuralp SEZER 9b447296bf Merge pull request #1142 from roboflow/dependabot/pip/ruff-0.4.2
⬆️ Bump ruff from 0.4.1 to 0.4.2
2024-04-26 03:42:20 +03:00
Onuralp SEZER 4a16d66bfb Merge pull request #1141 from roboflow/dependabot/pip/mkdocs-material-9.5.19
⬆️ Bump mkdocs-material from 9.5.18 to 9.5.19
2024-04-26 03:41:54 +03:00
dependabot[bot] 8436f52f8a ⬆️ Bump ruff from 0.4.1 to 0.4.2
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.1 to 0.4.2.
- [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.4.1...v0.4.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-26 00:33:10 +00:00
dependabot[bot] 059583e2ba ⬆️ Bump mkdocs-material from 9.5.18 to 9.5.19
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.18 to 9.5.19.
- [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.5.18...9.5.19)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-26 00:31:25 +00:00
pre-commit-ci[bot] 4bd593fe3c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-25 12:02:23 +00:00
Linas Kondrackis 399342513a Keypoints: rm NAS skeleton, improve docs examples 2024-04-25 15:00:01 +03:00
Linas Kondrackis c8c2ff5c45 Minor styling 2024-04-25 12:53:09 +03:00
Linas Kondrackis 18b3c17ed4 Styling 2024-04-25 12:42:33 +03:00
Linas Kondrackis cab06f2c2b Implementation of from_yolo_nas for keypoints
* Missing batch image support
2024-04-25 12:29:08 +03:00
Onuralp SEZER 2b53216a0b Merge pull request #1137 from roboflow/dependabot/pip/mypy-1.10.0
⬆️ Bump mypy from 1.9.0 to 1.10.0
2024-04-25 03:51:18 +03:00
dependabot[bot] e253f86e8f ⬆️ Bump mypy from 1.9.0 to 1.10.0
Bumps [mypy](https://github.com/python/mypy) from 1.9.0 to 1.10.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-25 00:46:24 +00:00
Piotr Skalski df4c546c10 Merge pull request #1076 from rolson24/add-minimum_consecutive_frames-to-bytetrack-better
add minimum_consecutive_frames to bytetrack
2024-04-25 00:25:18 +02:00
Piotr Skalski 25fc1ab6fa Merge pull request #1115 from jeslinpjames/update-examples
Update examples to remove `frame_resloution_wh` in [PolygonZone]
2024-04-24 22:43:47 +02:00
SkalskiP a45341ce63 final cleanup; setting supervision>=0.20.0 in requirements.txt and refactoring stream processing scripts 2024-04-24 22:41:59 +02:00
Piotr Skalski e93ef041d4 Merge pull request #1133 from roboflow/main
Merge pull request #1127 from roboflow/develop
2024-04-24 22:22:42 +02:00
Piotr Skalski f7f40f09ba Merge pull request #1127 from roboflow/develop
`supervision-0.20.0` release
2024-04-24 19:34:57 +02:00
Piotr Skalski c5f92a544b Merge pull request #1132 from roboflow/docs/supervision-0.20.0-changelog
docs/supervision 0.20.0 change log
2024-04-24 19:32:32 +02:00
SkalskiP d6a59cb851 Merge remote-tracking branch 'origin/docs/supervision-0.20.0-changelog' into docs/supervision-0.20.0-changelog 2024-04-24 19:25:54 +02:00
SkalskiP 5c4ed2650e drop accidentally committed from_inference 2024-04-24 19:25:45 +02:00
pre-commit-ci[bot] 6ae99444b5 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 17:24:18 +00:00
SkalskiP 7a90eefd5b changelog updated version bump from 0.20.0rc2 to 0.20.0 2024-04-24 19:22:59 +02:00
SkalskiP 65ddf9d67d Merge remote-tracking branch 'origin/develop' into develop 2024-04-24 16:57:44 +02:00
Piotr Skalski b0840911fc Merge pull request #1131 from roboflow/docs/refactor_before_0.20.0_release
docs/refactor before supervision 0.20.0 release
2024-04-24 16:47:06 +02:00
pre-commit-ci[bot] f4fca3339d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 14:45:20 +00:00
SkalskiP d7da00c55b make pre-commit happy 2024-04-24 16:43:40 +02:00
pre-commit-ci[bot] 383c1a1d8d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 14:39:03 +00:00
SkalskiP e5d1ac7238 Merge remote-tracking branch 'origin/docs/refactor_before_0.20.0_release' into docs/refactor_before_0.20.0_release 2024-04-24 16:38:47 +02:00
SkalskiP 895562d444 make pre-commit happy 2024-04-24 16:37:41 +02:00
pre-commit-ci[bot] 263420758e fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 14:36:17 +00:00
SkalskiP 1c42838ca1 improved docs linking 2024-04-24 16:35:34 +02:00
SkalskiP 908f3d14c6 improved docs linking 2024-04-24 16:28:48 +02:00
SkalskiP 389453777e vertex and edge annotators visualizations added 2024-04-24 16:18:21 +02:00
SkalskiP 77793571b0 major docs refactor 2024-04-24 15:39:08 +02:00
Linas Kondrackis 48809c1332 Add a basic from_supervision function to KeyPoints 2024-04-24 16:37:41 +03:00
Piotr Skalski 2c90a1ef1e Merge pull request #1129 from roboflow/fix/keypoints-no-detections
Fix keypoint crash with no detections
2024-04-24 14:07:49 +02:00
Linas Kondrackis 4b89bece4f Fix keypoint crash with no detections 2024-04-24 14:59:57 +03:00
Piotr Skalski 80e5413402 Merge pull request #1128 from roboflow/feat/dev/keypoints-annotated
initial key point support and annotators
2024-04-24 12:25:58 +02:00
Linas Kondrackis 741309fd09 Remove Skeleton from __init__, small renames, consts 2024-04-24 13:13:10 +03:00
pre-commit-ci[bot] 08d7a6b4cd fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 09:53:36 +00:00
Linas Kondrackis d1c103ee16 Best skeleton cache ever, obviously 2024-04-24 12:50:19 +03:00
pre-commit-ci[bot] 0f6ad236eb fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 09:45:47 +00:00
Linas Kondrackis 1c27bf7fea EdgeAnnotator, warn and not crash when None 2024-04-24 12:44:29 +03:00
pre-commit-ci[bot] 0749efed8f fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-24 06:52:19 +00:00
Linas Kondrackis d8681b8b4f remove xy_all, turn to for xy in keypoints.xy 2024-04-24 09:51:40 +03:00
pre-commit-ci[bot] 9ad35bcfb9 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-23 22:44:02 +00:00
SkalskiP 102c5adc38 test simplified skeleton API 2024-04-24 00:43:46 +02:00
SkalskiP a2dbbcce63 Merge remote-tracking branch 'origin/feat/dev/keypoints-annotated' into feat/dev/keypoints-annotated 2024-04-24 00:24:29 +02:00
SkalskiP 397b2249a7 fix typo 2024-04-24 00:24:21 +02:00
pre-commit-ci[bot] e2865ecda7 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-23 22:21:49 +00:00
SkalskiP 0ff1cfac07 Merge remote-tracking branch 'origin/feat/dev/keypoints-annotated' into feat/dev/keypoints-annotated 2024-04-24 00:21:30 +02:00
SkalskiP 2745c70ae0 docs plugged into mkdocs.yml 2024-04-24 00:21:19 +02:00
pre-commit-ci[bot] e2fabc1cfe fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-23 21:57:30 +00:00
SkalskiP a8d5e05885 Merge remote-tracking branch 'origin/feat/dev/keypoints-annotated' into feat/dev/keypoints-annotated 2024-04-23 23:57:16 +02:00
SkalskiP 9789ff4043 solve CI tests 2024-04-23 23:57:08 +02:00
SkalskiP 0274c45dbc solve CI tests 2024-04-23 23:12:54 +02:00
SkalskiP 6a541845ba Merge branch 'develop' into feat/dev/keypoints-annotated 2024-04-23 23:07:37 +02:00
pre-commit-ci[bot] 409dcbd9da fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-23 20:49:06 +00:00
Linas Kondrackis 07482a347c Keypoints: Multi-person annotators 2024-04-23 20:43:14 +03:00
Linas Kondrackis 7f0ecbbd0a Keypoints: Smart skellies 2024-04-23 20:19:28 +03:00
Linas Kondrackis a00604bfb2 Keypoints: Expose KeyPoints, annotators in __init__ 2024-04-23 19:28:34 +03:00
Linas Kondrackis d079ce92df Keypoints: Separate-out skeleton annotator 2024-04-23 19:26:12 +03:00
Linas Kondrackis a6b563cf4d Add keypoints skeleton, 2x annotators 2024-04-23 17:18:34 +03:00
Onuralp SEZER 7c2aad194a Merge pull request #1124 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-04-23 00:47:00 +03:00
pre-commit-ci[bot] feae6d3f78 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.7 → v0.4.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.7...v0.4.1)
2024-04-22 17:43:51 +00:00
Onuralp SEZER 4ebace283c Merge pull request #1123 from roboflow/dependabot/pip/ruff-0.4.1
⬆️ Bump ruff from 0.4.0 to 0.4.1
2024-04-22 04:03:29 +03:00
dependabot[bot] 98493c2ae1 ⬆️ Bump ruff from 0.4.0 to 0.4.1
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.4.0 to 0.4.1.
- [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.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 00:45:54 +00:00
Onuralp SEZER 8b32815648 Merge pull request #1122 from roboflow/dependabot/pip/ruff-0.4.0
⬆️ Bump ruff from 0.3.7 to 0.4.0
2024-04-19 13:36:40 +03:00
dependabot[bot] a1a66e7078 ⬆️ Bump ruff from 0.3.7 to 0.4.0
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.7 to 0.4.0.
- [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.3.7...v0.4.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-19 00:17:17 +00:00
Onuralp SEZER fd4ef9960a Merge pull request #1119 from roboflow/dependabot/pip/mkdocs-material-9.5.18
⬆️ Bump mkdocs-material from 9.5.17 to 9.5.18
2024-04-18 08:39:53 +03:00
Onuralp SEZER 6c54da2afa Merge pull request #1121 from roboflow/dependabot/pip/notebook-7.1.3
⬆️ Bump notebook from 7.1.2 to 7.1.3
2024-04-18 08:39:31 +03:00
dependabot[bot] 53eb76922d ⬆️ Bump notebook from 7.1.2 to 7.1.3
Bumps [notebook](https://github.com/jupyter/notebook) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/@jupyter-notebook/tree@7.1.3/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.1.2...@jupyter-notebook/tree@7.1.3)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-18 00:42:40 +00:00
dependabot[bot] b3f022b15a ⬆️ Bump mkdocs-material from 9.5.17 to 9.5.18
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.17 to 9.5.18.
- [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.5.17...9.5.18)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-17 00:29:27 +00:00
Onuralp SEZER 91e03ce903 Merge pull request #1118 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-04-15 23:25:35 +03:00
pre-commit-ci[bot] 2af86e56f0 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.5 → v0.3.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.5...v0.3.7)
2024-04-15 17:52:01 +00:00
Onuralp SEZER af0ece26d7 Merge pull request #1117 from roboflow/dependabot/pip/ruff-0.3.7
⬆️ Bump ruff from 0.3.6 to 0.3.7
2024-04-15 14:15:29 +03:00
dependabot[bot] 77d3276ad6 ⬆️ Bump ruff from 0.3.6 to 0.3.7
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.6 to 0.3.7.
- [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.3.6...v0.3.7)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 01:13:38 +00:00
Jeslin P James df4a6f857c added docs for RichLabelAnnotator 2024-04-13 18:58:18 +05:30
pre-commit-ci[bot] cb220479eb fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-13 13:16:16 +00:00
Jeslin P James 8bb8ce0316 changed error message and formatted code 2024-04-13 18:03:08 +05:30
Jeslin P James 8255bcb1ca Moved resolve_text_background_xyxy() function into utils.py 2024-04-13 17:43:52 +05:30
Jeslin P James 8329d155e4 Use default font when font_path isnt specified 2024-04-13 17:27:27 +05:30
Jeslin P James a41eea7c45 Merge branch 'develop' of github.com:jeslinpjames/supervision into RichLabelAnnotator 2024-04-13 13:36:26 +05:30
pre-commit-ci[bot] d531c59f85 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-13 05:39:05 +00:00
Jeslin P James 15b1473c2f Updated examples to remove frame_resolution_wh from PolygonZone 2024-04-13 10:28:11 +05:30
Jeslin P James 26c2a7ef9c updated examples 2024-04-13 10:18:30 +05:30
Piotr Skalski c8d2a54ed8 Merge pull request #1078 from roboflow/docs/ci/release-docs
ci: 👷 supervision documentation 📚 release CI added
2024-04-12 17:49:26 +02:00
Onuralp SEZER 9d9acd7e58 Merge pull request #1112 from roboflow/dependabot/pip/idna-3.7
⬆️ Bump idna from 3.6 to 3.7
2024-04-12 17:26:41 +03:00
Piotr Skalski f9ed80f91b Merge pull request #1109 from jeslinpjames/polygonzone-update
Dropped frame_resolution_wh from [PolygonZone]
2024-04-12 16:23:56 +02:00
SkalskiP dfd9fc8e6d fix too long string 2024-04-12 16:17:29 +02:00
SkalskiP 2c62f0b26d drop frame_resolution_wh from docs 2024-04-12 16:15:10 +02:00
SkalskiP 0ad3796571 bug fix 2024-04-12 16:13:09 +02:00
Onuralp SEZER da236aa565 Merge pull request #1110 from roboflow/dependabot/pip/ruff-0.3.6
⬆️ Bump ruff from 0.3.5 to 0.3.6
2024-04-12 16:19:30 +03:00
Jeslin P James 0800b0569f Merge branch 'polygonzone-update' of github.com:jeslinpjames/supervision into polygonzone-update 2024-04-12 16:46:02 +05:30
Jeslin P James 510df54572 Updated order of parameters in PolygonZone __init__() 2024-04-12 16:16:48 +05:30
dependabot[bot] 89d84d1f74 ⬆️ Bump idna from 3.6 to 3.7
Bumps [idna](https://github.com/kjd/idna) from 3.6 to 3.7.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst)
- [Commits](https://github.com/kjd/idna/compare/v3.6...v3.7)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 04:14:49 +00:00
dependabot[bot] 7126adc74a ⬆️ Bump ruff from 0.3.5 to 0.3.6
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.5 to 0.3.6.
- [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.3.5...v0.3.6)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-12 00:13:05 +00:00
pre-commit-ci[bot] 743e42080b fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-11 13:57:50 +00:00
Jeslin P James b64c61c388 formated code 2024-04-11 19:04:06 +05:30
Jeslin P James 28baf18cb6 updated PolygonZone Attributes docs 2024-04-11 18:59:48 +05:30
pre-commit-ci[bot] 361e444f53 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-11 13:27:43 +00:00
Jeslin P James b7607c6f15 Updated PolyZone class to compute frame_resolution_wh based on polygon coordinates 2024-04-11 18:57:30 +05:30
Raif Olson 07756328db Merge branch 'add-minimum_consecutive_frames-to-bytetrack-better' of https://github.com/rolson24/supervision into add-minimum_consecutive_frames-to-bytetrack-better 2024-04-11 09:27:28 -04:00
Raif Olson f98ded49a2 fix 2024-04-11 09:27:24 -04:00
pre-commit-ci[bot] bcb31f8809 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-11 13:21:51 +00:00
Raif Olson b1d5d4faf0 fix to exactly match existing release version when minimum_consecutive_frames = 1 2024-04-11 09:21:32 -04:00
Piotr Skalski d3dbe7c597 Update README.md 2024-04-11 14:54:22 +02:00
Piotr Skalski 9284bfdcd9 Update README.md 2024-04-11 14:44:50 +02:00
Piotr Skalski 263421d145 Update README.md 2024-04-11 14:40:43 +02:00
Raif Olson 7924a13dc5 only assign external track_id once 2024-04-11 08:28:08 -04:00
pre-commit-ci[bot] 755f292ed1 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-11 12:21:46 +00:00
Raif Olson 6166d92458 fix reassigning track_id after a track is re-activated. 2024-04-11 08:21:26 -04:00
Piotr Skalski ed225187b2 Update README.md 2024-04-11 14:09:02 +02:00
mario-dg 166a8da9a0 Implement Feedback 2024-04-11 12:22:44 +02:00
pre-commit-ci[bot] 2c9a1f69c5 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-10 17:57:46 -04:00
pre-commit-ci[bot] a2ab113f21 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-10 17:57:46 -04:00
Raif Olson eaff97f902 add external and internal track_ids to keep valid track ids sequential 2024-04-10 17:57:45 -04:00
Onuralp SEZER 855f9191c5 Merge pull request #1107 from LinasKo/feature/new-video-beach
Add beach drone footage asset
2024-04-10 09:46:25 +03:00
Linas Kondrackis 98b64f5e7d Add beach drone footage asset 2024-04-10 09:34:44 +03:00
Onuralp SEZER 048d1a8b98 Merge pull request #1106 from roboflow/dependabot/pip/mkdocs-jupyter-0.24.7
⬆️ Bump mkdocs-jupyter from 0.24.3 to 0.24.7
2024-04-10 03:35:14 +03:00
dependabot[bot] 2fd5452181 ⬆️ Bump mkdocs-jupyter from 0.24.3 to 0.24.7
Bumps [mkdocs-jupyter](https://github.com/danielfrg/mkdocs-jupyter) from 0.24.3 to 0.24.7.
- [Changelog](https://github.com/danielfrg/mkdocs-jupyter/blob/main/CHANGELOG.md)
- [Commits](https://github.com/danielfrg/mkdocs-jupyter/compare/0.24.3...0.24.7)

---
updated-dependencies:
- dependency-name: mkdocs-jupyter
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-10 00:14:47 +00:00
Piotr Skalski 10843c9989 Merge pull request #1104 from roboflow/letterbox_pr_docs_improvements
docs improvements related to #1028 PR
2024-04-09 23:19:44 +02:00
SkalskiP eb1c7716ef make ruff happy 2024-04-09 23:18:02 +02:00
pre-commit-ci[bot] c27d9eaf22 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 21:16:21 +00:00
SkalskiP 5eb43a25c9 Merge remote-tracking branch 'origin/letterbox_pr_docs_improvements' into letterbox_pr_docs_improvements 2024-04-09 23:15:57 +02:00
SkalskiP e0d5f00ae3 initial version of How to Save Detections guide done 2024-04-09 23:15:49 +02:00
pre-commit-ci[bot] 99fbd4b601 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 20:45:09 +00:00
SkalskiP d155592f45 Merge remote-tracking branch 'origin/letterbox_pr_docs_improvements' into letterbox_pr_docs_improvements 2024-04-09 22:44:54 +02:00
SkalskiP d929d6f58b How to Save Detections guide update 2024-04-09 22:44:10 +02:00
pre-commit-ci[bot] 6248fa7d17 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 20:08:13 +00:00
SkalskiP 7ad50cc7c2 Merge remote-tracking branch 'origin/letterbox_pr_docs_improvements' into letterbox_pr_docs_improvements 2024-04-09 22:07:58 +02:00
SkalskiP c30e377eb5 more docs improvements 2024-04-09 22:07:12 +02:00
pre-commit-ci[bot] f872fddaff fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 19:24:04 +00:00
SkalskiP 079e62fb0c rename place_image to overlay image 2024-04-09 21:23:23 +02:00
mario-dg 5f0dcc2cb2 Merge branch 'develop' into add_nmm_to_detections to resolve conflicts 2024-04-09 18:50:55 +02:00
Jeslin P James 9e906c78f5 annotate function added in RichLabelAnnotator 2024-04-09 22:14:36 +05:30
SkalskiP 774ac2ed4f update letterbox_image docs 2024-04-09 17:59:19 +02:00
pre-commit-ci[bot] a7dccfcc0d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 15:48:33 +00:00
Onuralp SEZER 15a4555b6a Merge pull request #1102 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-04-09 18:48:21 +03:00
SkalskiP 233d25d4c5 fix resize_image tests after rename 2024-04-09 17:48:13 +02:00
Jeslin P James 2417b36006 resolve_text_background_xyxy() function added to RichLabelAnnotator 2024-04-09 20:39:53 +05:30
pre-commit-ci[bot] ad94689362 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 14:46:48 +00:00
SkalskiP 94e06ab0d6 scale_image, resize_image changes 2024-04-09 16:46:05 +02:00
Onuralp SEZER b63379749e fix(keypoint): 🚀 getitem and setitem funcs added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-04-09 17:43:40 +03:00
Onuralp SEZER 5d43e1380d feat(test): 🚀 mock keypoints added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-04-09 17:42:31 +03:00
Onuralp SEZER 7d0cf8a723 feat: 🚀 initial sv.Keypoints features added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-04-09 15:51:16 +03:00
pre-commit-ci[bot] f2e6d882fb fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 12:50:50 +00:00
SkalskiP 2115c9a152 crop_image improvements 2024-04-09 14:50:32 +02:00
pre-commit-ci[bot] 5b1ee8f870 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-09 12:31:32 +00:00
SkalskiP 574c61b6b0 initial commit 2024-04-09 14:28:40 +02:00
Jeslin P James 1a7309e7c9 RichLabelAnnotator class added 2024-04-09 16:51:41 +05:30
pre-commit-ci[bot] 6b682f00ae chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.5.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.5.0...v4.6.0)
- [github.com/astral-sh/ruff-pre-commit: v0.3.4 → v0.3.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.4...v0.3.5)
2024-04-08 17:55:20 +00:00
Onuralp SEZER 4729e20a94 Merge pull request #1099 from roboflow/dependabot/pip/mkdocstrings-0.24.3
⬆️ Bump mkdocstrings from 0.24.2 to 0.24.3
2024-04-08 04:16:40 +03:00
dependabot[bot] b5ccc99537 ⬆️ Bump mkdocstrings from 0.24.2 to 0.24.3
Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.24.2 to 0.24.3.
- [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.24.2...0.24.3)

---
updated-dependencies:
- dependency-name: mkdocstrings
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 01:11:06 +00:00
Onuralp SEZER 922ebb237a Merge pull request #1097 from pirnerjonas/fix/formatting-in-docs
fix: formatting in notebook.md
2024-04-07 09:54:33 +03:00
Jonas Pirner 0ae2c1206f fix: formatting in notebook.md 2024-04-06 21:40:19 +02:00
Piotr Skalski 372e703a7a Merge pull request #1028 from roboflow/feature/add_tiles_generator
Add util to create image tiles
2024-04-05 18:37:19 +02:00
pre-commit-ci[bot] 0a919db9fd fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-05 16:02:57 +00:00
SkalskiP 473f140133 create_batches and fill docs added 2024-04-05 18:01:17 +02:00
pre-commit-ci[bot] e93224570f fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-05 15:51:35 +00:00
SkalskiP 5e9c3fdfa5 refactor tests to use @pytest.mark.parametrize 2024-04-05 17:51:08 +02:00
Paweł Pęczek b76f864f70 Rename decorators to convert images to acceptable format 2024-04-05 17:45:49 +02:00
SkalskiP c9095881ae docs updates 2024-04-05 17:33:52 +02:00
Piotr Skalski 299c933c4c Merge pull request #1093 from macc-n/ultralytics-results
Fixed obb key check in ultralytics_results
2024-04-05 13:38:06 +02:00
Piotr Skalski 9ae69c71d9 Merge pull request #1084 from sharingan000/geometry-utils-update-polygon-center-getter
Geometry utils update polygon center getter
2024-04-05 13:07:44 +02:00
Piotr Skalski a60884d94f Merge pull request #1046 from jeslinpjames/feature/transformers-support
Enhanced from_transformers to support class name extraction
2024-04-05 12:12:30 +02:00
SkalskiP e2f1d5812e docs improvements 2024-04-05 12:10:10 +02:00
pre-commit-ci[bot] dd7fddb4f5 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-05 09:50:00 +00:00
SkalskiP ee38ba36c4 docs improvements 2024-04-05 11:49:43 +02:00
macc-n 79da48fc49 If conditions merged 2024-04-04 18:45:42 +02:00
pre-commit-ci[bot] 7e21aaaa1a fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-04 16:16:35 +00:00
sharingan000 57335ef986 just comments 2024-04-05 02:14:44 +10:00
sharingan000 c605687f82 Ehe fix :) 2024-04-05 02:06:03 +10:00
sharingan000 6001e4033e Merge remote-tracking branch 'origin/geometry-utils-update-polygon-center-getter' into geometry-utils-update-polygon-center-getter 2024-04-05 02:04:03 +10:00
sharingan000 761fb89241 Fixed test/geometry/test_utils 2024-04-05 02:03:53 +10:00
pre-commit-ci[bot] 5f0082048c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-04 16:01:22 +00:00
sharingan000 0b86478417 Only solid algorithm geometry/utils 2024-04-05 02:00:54 +10:00
macc-n c8ea42af6d Fixed obb key check in ultralytics_results 2024-04-04 17:32:41 +02:00
sharingan000 40200ddd8d Merge remote-tracking branch 'origin/develop' into geometry-utils-update-polygon-center-getter 2024-04-04 15:01:49 +10:00
pre-commit-ci[bot] 8de73738c7 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-04 04:59:31 +00:00
sharingan000 0cf31d7e55 Merge remote-tracking branch 'origin/geometry-utils-update-polygon-center-getter' into geometry-utils-update-polygon-center-getter
# Conflicts:
#	supervision/geometry/utils.py
2024-04-04 14:58:36 +10:00
sharingan000 eb3317694e Include all three algorithms 2024-04-04 14:57:57 +10:00
pre-commit-ci[bot] 960e2529b1 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-03 10:44:27 +00:00
sharingan000 b7d18681b1 Merge remote-tracking branch 'origin/geometry-utils-update-polygon-center-getter' into geometry-utils-update-polygon-center-getter 2024-04-03 20:42:48 +10:00
sharingan000 cd81c1cef4 Updated algorithm 2024-04-03 20:40:54 +10:00
Onuralp SEZER fe1e0d9bec Merge pull request #1088 from roboflow/dependabot/pip/mkdocs-material-9.5.17
⬆️ Bump mkdocs-material from 9.5.16 to 9.5.17
2024-04-03 03:44:53 +03:00
Onuralp SEZER 275c7c6cc3 Merge pull request #1087 from roboflow/dependabot/pip/mkdocstrings-0.24.2
⬆️ Bump mkdocstrings from 0.24.1 to 0.24.2
2024-04-03 03:44:39 +03:00
dependabot[bot] 79c731b431 ⬆️ Bump mkdocs-material from 9.5.16 to 9.5.17
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.16 to 9.5.17.
- [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.5.16...9.5.17)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-03 00:35:04 +00:00
dependabot[bot] f15a6224ff ⬆️ Bump mkdocstrings from 0.24.1 to 0.24.2
Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.24.1 to 0.24.2.
- [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.24.1...0.24.2)

---
updated-dependencies:
- dependency-name: mkdocstrings
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-03 00:30:06 +00:00
jeslinpjames b6b72eddce add defensive checks to from_transformers 2024-04-02 18:53:42 +05:30
jeslinpjames b02e8664a1 mark id2label as Optional in from_transformers docs 2024-04-02 18:39:24 +05:30
jeslinpjames c7a0f62dea Merge branch 'develop' of github.com:jeslinpjames/supervision into feature/transformers-support 2024-04-02 18:20:53 +05:30
pre-commit-ci[bot] dcad812c5c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-04-02 07:15:15 +00:00
sharingan000 7ded0bd493 Change the method of finding polygon center and create test for new function 2024-04-02 16:55:03 +10:00
sharingan000 a38ae3f840 Change the method of finding polygon center and create test for new function 2024-04-02 16:54:34 +10:00
Onuralp SEZER 175dd7d0f5 Merge pull request #1082 from roboflow/dependabot/pip/ruff-0.3.5
⬆️ Bump ruff from 0.3.4 to 0.3.5
2024-04-02 04:06:40 +03:00
Onuralp SEZER 173a5d63a2 Merge pull request #1083 from roboflow/dependabot/pip/pillow-10.3.0
⬆️ Bump pillow from 10.2.0 to 10.3.0
2024-04-02 04:06:06 +03:00
dependabot[bot] f21597446b ⬆️ Bump pillow from 10.2.0 to 10.3.0
Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-02 00:47:42 +00:00
dependabot[bot] da5dfef2ed ⬆️ Bump ruff from 0.3.4 to 0.3.5
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.4 to 0.3.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.3.4...v0.3.5)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-02 00:45:56 +00:00
Onuralp SEZER 03803a7d7e Merge pull request #1079 from roboflow/dependabot/pip/mkdocs-material-9.5.16
⬆️ Bump mkdocs-material from 9.5.15 to 9.5.16
2024-04-01 04:13:13 +03:00
dependabot[bot] cbc5aa49f5 ⬆️ Bump mkdocs-material from 9.5.15 to 9.5.16
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.15 to 9.5.16.
- [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.5.15...9.5.16)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-01 00:50:45 +00:00
Onuralp SEZER 8fc5413394 ci: 👷 supervision documentation 📚 release CI added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-04-01 02:37:57 +03:00
Raif Olson ad0e6c3b51 Add minimum consecutive frames to ByteTrack 2024-03-29 16:59:29 -04:00
Onuralp SEZER b5250105e0 Merge pull request #1071 from roboflow/dependabot/pip/build-1.2.1
⬆️ Bump build from 1.2.0 to 1.2.1
2024-03-29 16:34:00 +03:00
dependabot[bot] 90ad1c2c9a ⬆️ Bump build from 1.2.0 to 1.2.1
Bumps [build](https://github.com/pypa/build) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/pypa/build/releases)
- [Changelog](https://github.com/pypa/build/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/build/compare/1.2.0...1.2.1)

---
updated-dependencies:
- dependency-name: build
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-29 00:38:59 +00:00
jeslinpjames 7dedc452b7 Added missing data field 2024-03-29 01:44:37 +05:30
jeslinpjames 767f9a7148 formatted code 2024-03-29 01:14:10 +05:30
jeslinpjames e6a1d58500 Update documentation for from_transformers function 2024-03-29 01:11:17 +05:30
jeslinpjames a8988d1d4d Enhance from_transformers to support class name extraction for Transformers 2024-03-29 01:05:49 +05:30
jeslinpjames 42a4ed4166 Merge branch 'develop' of github.com:jeslinpjames/supervision into feature/transformers-support 2024-03-29 00:47:29 +05:30
Piotr Skalski f4f9b3d53a Merge pull request #1068 from roboflow/docs/anaconda-install
docs: 📚 conda and mamba installation methods added
2024-03-28 18:55:47 +01:00
pre-commit-ci[bot] 719af725b1 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-28 17:53:57 +00:00
SkalskiP e88ab7c125 small update 2024-03-28 18:53:39 +01:00
Piotr Skalski 77e38ba93b Merge pull request #1069 from roboflow/from_transformers_improvements
`from_transformers` improvements
2024-03-28 17:17:18 +01:00
SkalskiP 68e1bae6de Merge remote-tracking branch 'origin/from_transformers_improvements' into from_transformers_improvements 2024-03-28 16:34:25 +01:00
SkalskiP afc31e42a5 few more improvements 2024-03-28 16:34:05 +01:00
pre-commit-ci[bot] 0c7c746f15 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-28 15:10:30 +00:00
SkalskiP 4ad78becb6 initial comment 2024-03-28 16:08:05 +01:00
Onuralp SEZER f9fd88fb01 docs: 📚 conda and mamba installation methods added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-28 18:00:43 +03:00
SkalskiP ccc7118bcb bump version from 0.20.0rc1 to 0.20.0rc2 2024-03-28 15:41:16 +01:00
Piotr Skalski 2cccfc5b62 Merge pull request #1067 from roboflow/ci/dev-ci
fix: 🐞 ci trigger error fix
2024-03-28 15:39:00 +01:00
Onuralp SEZER 93584cbb89 fix: 🐞 ci trigger error fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-28 17:29:10 +03:00
Piotr Skalski 5bfc977fac Merge pull request #1065 from roboflow/revert-1064-ci/dev-ci
Revert "fix: 🐞 ci trigger error fix"
2024-03-28 15:21:42 +01:00
Piotr Skalski 16c41d9d5d Revert "fix: 🐞 ci trigger error fix" 2024-03-28 15:19:24 +01:00
SkalskiP 81c2a09430 bump version from 0.19.0 to 0.20.0rc1 2024-03-28 15:09:23 +01:00
Piotr Skalski 16b7222012 Merge pull request #1054 from Griffin-Sullivan/transformers-segmentation
Add segmentation model support to from_transformers
2024-03-28 14:40:08 +01:00
Piotr Skalski 6b2136d57b Merge pull request #1064 from roboflow/ci/dev-ci
fix: 🐞 ci trigger error fix
2024-03-28 14:38:50 +01:00
Piotr Skalski 908a1b4d89 Merge pull request #1049 from rolson24/fix-pr-bug
fix enumerate call
2024-03-28 14:36:40 +01:00
Onuralp SEZER 7e283d4eeb fix: 🐞 ci trigger error fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-28 16:28:21 +03:00
Raif Olson a2aca62ecb merge develop branch and change back to using boolean indexing 2024-03-28 09:27:54 -04:00
Onuralp SEZER 0a5fb7b47e Merge pull request #1060 from roboflow/dependabot/pip/build-1.2.0
⬆️ Bump build from 1.1.1 to 1.2.0
2024-03-28 16:22:50 +03:00
Piotr Skalski 7132c034ab Merge pull request #1063 from roboflow/get_data_item_tests
`get_data_item` unit tests
2024-03-28 14:09:15 +01:00
pre-commit-ci[bot] dc5f841bae fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-28 13:06:47 +00:00
SkalskiP 64eef66b54 get_data_item unit tests 2024-03-28 14:04:21 +01:00
Raif Olson dc45c0a5e0 Merge remote-tracking branch 'origin/develop' into fix-pr-bug 2024-03-28 08:48:05 -04:00
Piotr Skalski 69563b8bbb Merge pull request #1062 from rolson24/fix-Detections-call-bug
fix Detections.get_data_item() bug (#1061)
2024-03-28 13:40:57 +01:00
pre-commit-ci[bot] 29ba24f89a fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-28 12:39:14 +00:00
Raif Olson da4404e875 More pythonic version of change 2024-03-28 08:38:50 -04:00
Raif Olson 089594f72d fix Detections.get_data_item() bug 2024-03-27 23:59:40 -04:00
pre-commit-ci[bot] e9edc2fb1d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-28 03:39:22 +00:00
Raif Olson ad24d3811b Refactor update_with_detections for simplicity. Credit to @SkalskiP for the code. (had to change a few lines for bug fixes) 2024-03-27 23:38:55 -04:00
dependabot[bot] 8fb3ba70b0 ⬆️ Bump build from 1.1.1 to 1.2.0
Bumps [build](https://github.com/pypa/build) from 1.1.1 to 1.2.0.
- [Release notes](https://github.com/pypa/build/releases)
- [Changelog](https://github.com/pypa/build/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/build/compare/1.1.1...1.2.0)

---
updated-dependencies:
- dependency-name: build
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-28 00:56:05 +00:00
SkalskiP 34b80eb3c0 Fix YT videos paths 2024-03-27 09:12:45 +01:00
Piotr Skalski 3276973446 Update README.md 2024-03-27 00:14:19 +01:00
Piotr Skalskiandpre-commit-ci[bot] 725d95c6ce time in zone / dwell time demo (#1026)
* initial commit

* initial stream processing script

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

* work in progress

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

* work in progress

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

* ultralytics file and stream versions ready

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

* ultralytics file and stream versions ready

* class based filtering

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

* timer improvements

* inference static file processing script

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

* inference stream processing script

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

* all scripts are working

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

* all video or stream processing scripts refactored

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

* README.md update

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

* initial version of draw ones script

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

* loading image or video, drawing multiple polygons, quiting app, and aborting currently drawn polygon works.

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

* loading image or video, drawing multiple polygons, quiting app, and aborting currently drawn polygon works.

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

* Dynamic drawing of currently edited polygon.

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

* Drawing tool is ready.

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

* Final touches.

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

* Update README.md

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

* Update README.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-03-27 00:12:12 +01:00
pre-commit-ci[bot] 13f85ae6cc fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-26 21:05:04 +00:00
Griffin-Sullivan c67078b53c Add segmentation model support to from_transformers 2024-03-26 17:04:43 -04:00
Piotr Skalski 42f9d4b69b Merge pull request #1053 from roboflow/fix/ci-publish-bug
ci: 👷 publish pypi on branch removed
2024-03-26 18:24:36 +01:00
Onuralp SEZER d41caed36f ci: 👷 publish pypi on branch removed
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-26 18:38:04 +03:00
SkalskiP 5a040969d7 fix how-to links 2024-03-26 09:53:16 +01:00
Raif Olson 3ed4aeffff fix bugs in PR #1035
fix tuple unpacking bug in PR #1035

Fix bug with detections with un-initialized tracker_ids
2024-03-25 23:52:33 -04:00
pre-commit-ci[bot] c56c446eb6 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-26 02:06:09 +00:00
jeslinpjames 8a06de47e9 made id2label param optional and handle class names 2024-03-26 07:35:45 +05:30
jeslinpjames a51267a4fa Merge branch 'develop' of github.com:jeslinpjames/supervision into feature/transformers-support 2024-03-26 07:33:30 +05:30
Onuralp SEZER 97b8312570 Merge pull request #1045 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-03-26 00:26:55 +03:00
Piotr Skalski 94e9719f20 Merge pull request #1048 from roboflow/docs/detect_small_objects_updates
Detect Small Objects documentation 2
2024-03-25 22:12:16 +01:00
SkalskiP 0d16b13e7a Added additional visualization 2024-03-25 22:09:23 +01:00
Piotr Skalski 5c03173c7c Merge pull request #1047 from roboflow/docs/detect_small_objects
Detect Small Objects documentation
2024-03-25 21:25:30 +01:00
pre-commit-ci[bot] cf88cc0384 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-25 20:14:17 +00:00
SkalskiP 15e17adef1 Detect Small Objects documentation 2024-03-25 21:11:47 +01:00
pre-commit-ci[bot] 8694f0023d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-25 19:24:23 +00:00
jeslinpjames b2b417af5b Enhanced from_transformers to support class name extraction 2024-03-26 00:39:11 +05:30
Paweł Pęczek 0aacfa47d3 Add new utils to library interface 2024-03-25 19:47:45 +01:00
Paweł Pęczek de8222203c Add tests for tiles creation 2024-03-25 19:44:46 +01:00
pre-commit-ci[bot] ca425a628d chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.3 → v0.3.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.3...v0.3.4)
2024-03-25 17:44:14 +00:00
Piotr Skalski 09a47bec62 Merge pull request #1037 from xaristeidou/round-edge-label-annotator
Add `corner_radius` to `sv.LabelAnnotator` to handle roundness of label edges.
2024-03-25 17:59:28 +01:00
pre-commit-ci[bot] 90f6893d3d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-25 16:29:16 +00:00
SkalskiP b585bb0724 test slightly simplified API 2024-03-25 17:28:59 +01:00
Piotr Skalski 495f9a9003 Merge pull request #1035 from rolson24/redesign-update_with_detections-to-match-Detections-with-tracker_id-v2
Fix issue #754
2024-03-25 16:15:37 +01:00
Paweł Pęczek 4adb2339a4 Add tests and docstrings for utils 2024-03-25 16:02:00 +01:00
Paweł Pęczek 444853054f Add docstrings for image module 2024-03-25 15:22:52 +01:00
Piotr Skalski 4a6a6dbf6b Merge pull request #1041 from roboflow/docs/how_to_detect_and_annotate_improvements
How to Detect and Annotate Tutorial Improvements
2024-03-25 15:10:58 +01:00
Paweł Pęczek 4bb711dcea Add draft of changes to support adding titles 2024-03-25 15:09:21 +01:00
SkalskiP fec251d979 fix LabelAnnotator code snippets 2024-03-25 15:01:59 +01:00
SkalskiP 6d27b8067b mention that VideoSink and ImageSink accept images in BGR color format. 2024-03-25 14:54:34 +01:00
Onuralp SEZER 3da0ca4ffc Merge pull request #1039 from roboflow/dependabot/pip/mkdocs-material-9.5.15
⬆️ Bump mkdocs-material from 9.5.14 to 9.5.15
2024-03-25 16:48:30 +03:00
Onuralp SEZER fc03b0c386 Merge pull request #1040 from roboflow/dependabot/pip/tox-4.14.2
⬆️ Bump tox from 4.14.1 to 4.14.2
2024-03-25 16:48:12 +03:00
pre-commit-ci[bot] 4660dfd0d3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-25 12:55:29 +00:00
SkalskiP e7b4d6ec41 more improvements 2024-03-25 13:55:13 +01:00
pre-commit-ci[bot] bc586562b5 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-25 12:14:44 +00:00
SkalskiP 57c6182325 initial changes 2024-03-25 13:11:47 +01:00
dependabot[bot] c3b617d47e ⬆️ Bump tox from 4.14.1 to 4.14.2
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.1 to 4.14.2.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.1...4.14.2)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 01:26:28 +00:00
dependabot[bot] 6458d4454d ⬆️ Bump mkdocs-material from 9.5.14 to 9.5.15
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.14 to 9.5.15.
- [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.5.14...9.5.15)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 01:07:38 +00:00
Christoforos Aristeidou 957ced0614 (pre-commit): align spacing 2024-03-24 11:42:19 +02:00
Christoforos Aristeidou ed3c73eb02 modified to use new custom method for rectangle drawing 2024-03-24 11:36:51 +02:00
Christoforos Aristeidou 3e4ddd5bd9 added new custom method that draws rounded rectangles 2024-03-24 11:36:10 +02:00
Christoforos Aristeidou 1fbdec6046 added corner_radius attribute to LabelAnnotator 2024-03-24 11:35:18 +02:00
Raif Olson 1eb877c4d9 Fix issue #754 2024-03-23 18:53:05 -05:00
Onuralp SEZER 781a064d8a Merge pull request #1030 from roboflow/dependabot/pip/ruff-0.3.4
⬆️ Bump ruff from 0.3.3 to 0.3.4
2024-03-22 04:40:54 +03:00
dependabot[bot] 70218b85e7 ⬆️ Bump ruff from 0.3.3 to 0.3.4
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.3 to 0.3.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.3.3...v0.3.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 01:05:54 +00:00
Onuralp SEZER 37318fafdf Merge pull request #1029 from roboflow/dependabot/pip/nbconvert-7.16.3
⬆️ Bump nbconvert from 7.16.2 to 7.16.3
2024-03-22 03:56:13 +03:00
dependabot[bot] f377a992e1 ⬆️ Bump nbconvert from 7.16.2 to 7.16.3
Bumps [nbconvert](https://github.com/jupyter/nbconvert) from 7.16.2 to 7.16.3.
- [Release notes](https://github.com/jupyter/nbconvert/releases)
- [Changelog](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/nbconvert/compare/v7.16.2...v7.16.3)

---
updated-dependencies:
- dependency-name: nbconvert
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 00:52:54 +00:00
Paweł Pęczek 7eba338243 Add first draft of implementation for function creating image tiles 2024-03-20 23:08:39 +01:00
Piotr Skalski 6208013dcf Merge pull request #1003 from roboflow/adding-clor-border-to-crop-annotator
adding color border to crop annotator poc
2024-03-20 19:41:13 +01:00
SkalskiP 8a2abe72ae utils refactor 2024-03-20 19:37:03 +01:00
Piotr Skalski d01b636ebe Merge pull request #1024 from roboflow/security/ci/packaging
ci: 👷 publish pypi branch limitations added
2024-03-19 14:32:47 +01:00
Onuralp SEZER 0e3e41287a ci: 👷 publish pypi branch limitations added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-19 16:25:38 +03:00
Onuralp SEZER 5f9560afb8 Merge pull request #1020 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-03-19 06:34:06 +03:00
pre-commit-ci[bot] 4abd128af5 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.2 → v0.3.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.2...v0.3.3)
2024-03-18 17:48:56 +00:00
Piotr Skalski 77908fe49b Merge pull request #1012 from roboflow/feat/type-check-improvement
feat: 📝 static type improvement color constants and PolygonZone
2024-03-18 10:56:10 +01:00
Onuralp SEZER fb3a78f762 Merge pull request #1014 from roboflow/dependabot/pip/mkdocs-material-9.5.14
⬆️ Bump mkdocs-material from 9.5.13 to 9.5.14
2024-03-18 12:00:01 +03:00
Onuralp SEZER f43b3536be Merge pull request #1013 from roboflow/dependabot/pip/ruff-0.3.3
⬆️ Bump ruff from 0.3.2 to 0.3.3
2024-03-18 11:59:44 +03:00
dependabot[bot] 345c086916 ⬆️ Bump mkdocs-material from 9.5.13 to 9.5.14
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.13 to 9.5.14.
- [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.5.13...9.5.14)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 01:30:06 +00:00
dependabot[bot] 123a61f2c6 ⬆️ Bump ruff from 0.3.2 to 0.3.3
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.2 to 0.3.3.
- [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.3.2...v0.3.3)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 01:21:26 +00:00
Onuralp SEZER 63b338751f feat: 📝 typing improvement for polygone zone
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-17 18:16:05 +03:00
Onuralp SEZER e8810fe8a2 fix: 🐞 static type fix for color constants to sv.Color
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-17 14:42:58 +03:00
Piotr Skalski 3d9d45fc07 Merge pull request #1006 from roboflow/ci/doc/concurrency
ci: 👷 develop doc concurrency added for single run and cancel old ones
2024-03-17 12:26:48 +01:00
Onuralp SEZER 4f9e5a590f ci: 👷 develop doc concurrency added for single run and cancel old ones
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-15 22:20:02 +03:00
pre-commit-ci[bot] 9f5c63b32d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-15 11:02:26 +00:00
SkalskiP a5b1079e39 work in progress 2024-03-15 11:57:53 +01:00
Piotr Skalski 88d63473fe Merge pull request #1002 from roboflow/main
Merge pull request #991 from roboflow/develop
2024-03-15 11:18:53 +01:00
Piotr Skalski 55f93a85b6 Merge pull request #991 from roboflow/develop
`supervision-0.19.0` release
2024-03-15 11:15:24 +01:00
SkalskiP a0f7bb76bd bump version from 0.19.0rc5 to 0.19.0 2024-03-15 11:10:01 +01:00
Piotr Skalski 7e72ad13f7 Merge pull request #1000 from roboflow/0.19.0-changelog
`supervision-0.19.0` release changelog
2024-03-15 10:59:31 +01:00
Piotr Skalski 5b6713f197 Merge pull request #996 from roboflow/fix/doc_syntax_fix
doc: 📚 json and csv example code syntax fix
2024-03-15 10:59:08 +01:00
SkalskiP 8d7f18cc22 supervision-0.19.0 release changelog 2024-03-15 10:48:01 +01:00
Onuralp SEZER 012ff2bbe2 Merge pull request #997 from roboflow/dependabot/pip/notebook-7.1.2
⬆️ Bump notebook from 7.1.1 to 7.1.2
2024-03-15 11:20:11 +03:00
dependabot[bot] 594c9958a4 ⬆️ Bump notebook from 7.1.1 to 7.1.2
Bumps [notebook](https://github.com/jupyter/notebook) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.1.1...@jupyter-notebook/tree@7.1.2)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-15 00:57:18 +00:00
Onuralp SEZER 917b4c0fe4 doc: 📚 json and csv example code syntax fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-14 22:33:30 +03:00
Piotr Skalski d669619f2d Merge pull request #888 from xaristeidou/develop
Add `sv.CropAnnotator` which annotates a cropped part of detections
2024-03-14 14:47:43 +01:00
SkalskiP 22d97b8a46 add CropAnnotator docs 2024-03-14 14:43:19 +01:00
SkalskiP 0c04647d00 Improved docstrings 2024-03-14 14:37:26 +01:00
pre-commit-ci[bot] d6589443d7 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-14 13:13:09 +00:00
SkalskiP 4ba3780d86 CropAnnotator updates and fixes 2024-03-14 14:12:50 +01:00
pre-commit-ci[bot] d1003d420c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-14 12:33:18 +00:00
SkalskiP c7a6b38275 initial version of refactored CropAnnotator 2024-03-14 13:32:52 +01:00
Onuralp SEZER 0d352bde92 Merge pull request #913 from stellasphere/develop
Add occupancy analytics cookbook
2024-03-14 14:31:17 +03:00
Onuralp SEZER 4a6c0a9fa3 fix: 🐞 dirty outputs are removed and formatting fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-14 14:28:28 +03:00
Onuralp SEZER 423783a8ff Merge branch 'develop' into develop 2024-03-14 14:08:38 +03:00
Piotr Skalski 162a4828e8 Merge pull request #970 from roboflow/config/ruff
ci: 👷 update ruff config and group lint
2024-03-14 11:35:52 +01:00
Piotr Skalski 0b810817e3 Merge pull request #969 from roboflow/fix/depricated
fix: 🐞 update PolygonZone test and update traffic-analysis depricated codes are updated
2024-03-13 14:26:28 +01:00
SkalskiP 6ade84f057 Updated deprecated.md to include deprecations introduced in the supervision-0.19.0 release. 2024-03-13 13:47:39 +01:00
Piotr Skalski 655e5a7709 Merge pull request #994 from roboflow/fix/993_ImageDetectionPrediction_object_is_not_subscriptable
Fix for #993 TypeError: 'ImageDetectionPrediction' object is not subscriptable
2024-03-13 11:10:59 +01:00
pre-commit-ci[bot] dfb52633dc fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-13 10:08:31 +00:00
SkalskiP bc74e1c366 added the same fix to quickstart.ipynb 2024-03-13 11:08:13 +01:00
pre-commit-ci[bot] aacad59fd9 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-13 10:04:09 +00:00
SkalskiP 879d48048c ready for review 2024-03-13 11:02:11 +01:00
Onuralp SEZER c0c346b04b Merge pull request #992 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-03-12 23:45:08 +03:00
pre-commit-ci[bot] 8ea1148f75 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-03-12 20:30:21 +00:00
pre-commit-ci[bot] 2c55d1796f chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/PyCQA/bandit: 1.7.7 → 1.7.8](https://github.com/PyCQA/bandit/compare/1.7.7...1.7.8)
- [github.com/astral-sh/ruff-pre-commit: v0.2.2 → v0.3.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.2...v0.3.2)
2024-03-12 20:30:09 +00:00
Onuralp SEZER b68e7c2059 Merge pull request #989 from roboflow/dependabot/pip/wheel-0.43.0
⬆️ Bump wheel from 0.42.0 to 0.43.0
2024-03-12 05:32:31 +03:00
dependabot[bot] 4c426f5e82 ⬆️ Bump wheel from 0.42.0 to 0.43.0
Bumps [wheel](https://github.com/pypa/wheel) from 0.42.0 to 0.43.0.
- [Release notes](https://github.com/pypa/wheel/releases)
- [Changelog](https://github.com/pypa/wheel/blob/main/docs/news.rst)
- [Commits](https://github.com/pypa/wheel/compare/0.42.0...0.43.0)

---
updated-dependencies:
- dependency-name: wheel
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-12 00:23:55 +00:00
Onuralp SEZER fb82d32355 Merge pull request #987 from roboflow/dependabot/pip/pytest-8.1.1
⬆️ Bump pytest from 8.1.0 to 8.1.1
2024-03-11 04:07:33 +03:00
Onuralp SEZER fd6cf36685 Merge pull request #986 from roboflow/dependabot/pip/mypy-1.9.0
⬆️ Bump mypy from 1.8.0 to 1.9.0
2024-03-11 04:07:18 +03:00
Onuralp SEZER f41781015e Merge pull request #985 from roboflow/dependabot/pip/ruff-0.3.2
⬆️ Bump ruff from 0.3.1 to 0.3.2
2024-03-11 04:07:05 +03:00
dependabot[bot] b85222690b ⬆️ Bump pytest from 8.1.0 to 8.1.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.1.0 to 8.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.1.0...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 01:01:54 +00:00
dependabot[bot] 8ef3c0eb00 ⬆️ Bump mypy from 1.8.0 to 1.9.0
Bumps [mypy](https://github.com/python/mypy) from 1.8.0 to 1.9.0.
- [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/python/mypy/compare/v1.8.0...1.9.0)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 00:59:37 +00:00
dependabot[bot] 645a1ec7af ⬆️ Bump ruff from 0.3.1 to 0.3.2
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.1 to 0.3.2.
- [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.3.1...v0.3.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 00:52:12 +00:00
Piotr Skalski cadb259214 Merge pull request #980 from roboflow/add-retention
Script updates
2024-03-07 14:22:35 +00:00
James 26de63a09a Update main.html 2024-03-07 14:19:42 +00:00
Onuralp SEZER b38234babe Merge pull request #979 from roboflow/dependabot/pip/ruff-0.3.1
⬆️ Bump ruff from 0.3.0 to 0.3.1
2024-03-07 04:46:06 +03:00
Onuralp SEZER 26201862f1 Merge pull request #978 from roboflow/dependabot/pip/mkdocs-material-9.5.13
⬆️ Bump mkdocs-material from 9.5.12 to 9.5.13
2024-03-07 04:22:31 +03:00
dependabot[bot] c6f0b5753a ⬆️ Bump ruff from 0.3.0 to 0.3.1
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.3.0 to 0.3.1.
- [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.3.0...v0.3.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 00:46:53 +00:00
Onuralp SEZER 427c91baa6 Merge pull request #977 from roboflow/dependabot/pip/tox-4.14.1
⬆️ Bump tox from 4.14.0 to 4.14.1
2024-03-07 03:45:22 +03:00
dependabot[bot] dc39852a5b ⬆️ Bump mkdocs-material from 9.5.12 to 9.5.13
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.12 to 9.5.13.
- [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.5.12...9.5.13)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 00:44:39 +00:00
dependabot[bot] 52a059ffd9 ⬆️ Bump tox from 4.14.0 to 4.14.1
Bumps [tox](https://github.com/tox-dev/tox) from 4.14.0 to 4.14.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.14.0...4.14.1)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-07 00:42:57 +00:00
Onuralp SEZER 8900986775 Merge pull request #976 from roboflow/dependabot/pip/tox-4.14.0
⬆️ Bump tox from 4.13.0 to 4.14.0
2024-03-06 16:56:11 +03:00
Piotr Skalski 4abef15069 Update README.md 2024-03-06 11:20:43 +00:00
dependabot[bot] f1e596a058 ⬆️ Bump tox from 4.13.0 to 4.14.0
Bumps [tox](https://github.com/tox-dev/tox) from 4.13.0 to 4.14.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.13.0...4.14.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-06 01:00:05 +00:00
Onuralp SEZER cd20887d26 Merge pull request #974 from roboflow/dependabot/pip/nbconvert-7.16.2
⬆️ Bump nbconvert from 7.16.1 to 7.16.2
2024-03-05 23:31:16 +03:00
dependabot[bot] e1a950f691 ⬆️ Bump nbconvert from 7.16.1 to 7.16.2
Bumps [nbconvert](https://github.com/jupyter/nbconvert) from 7.16.1 to 7.16.2.
- [Release notes](https://github.com/jupyter/nbconvert/releases)
- [Changelog](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/nbconvert/compare/v7.16.1...v7.16.2)

---
updated-dependencies:
- dependency-name: nbconvert
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-05 00:33:56 +00:00
Onuralp SEZER b0a64751d0 Merge pull request #973 from roboflow/dependabot/pip/pytest-8.1.0
⬆️ Bump pytest from 8.0.2 to 8.1.0
2024-03-04 21:42:59 +03:00
dependabot[bot] 34648871ab ⬆️ Bump pytest from 8.0.2 to 8.1.0
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.2 to 8.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.2...8.1.0)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 01:23:55 +00:00
Onuralp SEZER 823adb3867 ci: 👷 update ruff config and group lint
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-02 03:57:13 +03:00
Onuralp SEZER 56825423dc fix: 🐞 update PolygonZone test and update traffic-analysis depricated codes are updated
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-02 03:25:59 +03:00
Onuralp SEZER e86fc592c7 Merge pull request #968 from roboflow/dependabot/pip/mkdocs-material-9.5.12
⬆️ Bump mkdocs-material from 9.5.11 to 9.5.12
2024-03-01 12:27:34 +03:00
Onuralp SEZER 3e05057ee4 Merge pull request #967 from roboflow/dependabot/pip/build-1.1.1
⬆️ Bump build from 1.0.3 to 1.1.1
2024-03-01 04:14:26 +03:00
dependabot[bot] a3e39bdb6f ⬆️ Bump mkdocs-material from 9.5.11 to 9.5.12
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.11 to 9.5.12.
- [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.5.11...9.5.12)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 01:10:04 +00:00
dependabot[bot] 199d26aa72 ⬆️ Bump build from 1.0.3 to 1.1.1
Bumps [build](https://github.com/pypa/build) from 1.0.3 to 1.1.1.
- [Release notes](https://github.com/pypa/build/releases)
- [Changelog](https://github.com/pypa/build/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pypa/build/compare/1.0.3...1.1.1)

---
updated-dependencies:
- dependency-name: build
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 01:01:54 +00:00
Onuralp SEZER ed3c6d1fbd Merge pull request #966 from roboflow/dependabot/pip/ruff-0.3.0
⬆️ Bump ruff from 0.2.2 to 0.3.0
2024-03-01 03:59:32 +03:00
dependabot[bot] f29bdec62e ⬆️ Bump ruff from 0.2.2 to 0.3.0
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.2 to 0.3.0.
- [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.2.2...v0.3.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 00:50:01 +00:00
Onuralp SEZER f55ef90716 Merge pull request #819 from AdonaiVera/allowing_serialise_detections_json
New function [JSONSink] - Allowing to serialise Detections to a JSON file
2024-03-01 03:23:46 +03:00
Adonai Vera d9496316bc remove the json output after finish the unit test 2024-03-01 03:14:42 +03:00
Adonai Vera 4509608a5d Apply documentation, unit test with mutliple scenarios, and improvement 2024-03-01 03:14:35 +03:00
Piotr Skalski 6eeb1c4ae3 Merge pull request #965 from roboflow/ci/doc-test
feat: 📚 add docs test workflow
2024-02-29 22:43:39 +01:00
Onuralp SEZER 4803ab26e5 feat: 📚 add docs test workflow
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-01 00:41:24 +03:00
Onuralp SEZER 852d518d7c fix: 🐞 evaluating-alignment-of-text-to-image-diffusion-model widget fix for docs to render (#964)
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-01 00:28:51 +03:00
Onuralp SEZER b78b3913fc Merge pull request #907 from iamhatesz/docs/alignment-cookbook
Add a cookbook about alignment evaluation
2024-03-01 00:04:59 +03:00
Onuralp SEZER 2407fad07e fix: 🐞 swap ultralytics to inference-gpu[yolo-world] usage and constants added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-03-01 00:03:55 +03:00
SkalskiP 73013d6e47 bump version from 0.19.0rc4 to 0.19.0rc5 2024-02-29 21:17:33 +01:00
Onuralp SEZER 41c78cceed Merge pull request #963 from roboflow/feat/plot_image/pillow
feat(ImageType): 🚀 sv.plot_images_grid and sv.plot_image can accept ImageType
2024-02-29 23:11:22 +03:00
Onuralp SEZER ce3356287e feat(ImageType): 🚀 sv.plot_images_grid and sv.plot_image can accept ImageType
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-29 23:09:01 +03:00
SkalskiP 0aff293841 bump version from 0.19.0rc3 to 0.19.0rc4 2024-02-29 20:04:24 +01:00
Onuralp SEZER b13e3e0b8e Merge pull request #962 from roboflow/feat/supervision/warnings
fix: 🐞 Custom warning type 'SupervisionWarning' added
2024-02-29 19:27:04 +03:00
Onuralp SEZER 18085340e2 feat: ⚠️ cleaner warning format added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-29 19:25:10 +03:00
Onuralp SEZER 7d65a9445a fix: 🐞 Custom warning type 'SupervisionWarning' added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-29 18:52:38 +03:00
Onuralp SEZER a68e5b4a6d Merge pull request #886 from Kadermiyanyedi/update-byte-track-class-argument-names
[ByteTrack] - change the names and documenting input arguments #787
2024-02-29 14:45:50 +03:00
Onuralp SEZER d3383fc02f feat: ✨ deprecated_parameters ⚠️ added and warning filter for show ALL warnings
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-29 14:42:38 +03:00
Piotr Skalski 6613f57a81 Merge pull request #961 from roboflow/ci/pypi/regex
ci: 👷 remove duplicated publish tag regex
2024-02-29 11:38:53 +01:00
Onuralp SEZER 00c84d4530 Merge branch 'develop' into update-byte-track-class-argument-names 2024-02-29 13:35:49 +03:00
Onuralp SEZER cefd9e100c ci: 👷 remove duplicated publish tag regex
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-29 12:54:22 +03:00
Piotr Skalski 07763bb2d0 Merge pull request #935 from NickHerrig/cookbooks/add-visuals
Cookbooks/add visuals
2024-02-29 10:36:16 +01:00
Piotr Skalski af03010a07 Merge pull request #960 from roboflow/small_deprecated_parameter_cleanup
update `deprecated_parameter` docs
2024-02-29 10:19:36 +01:00
pre-commit-ci[bot] f12182b016 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-29 09:15:25 +00:00
SkalskiP 25deda23f2 ready for test in colab 2024-02-29 10:11:29 +01:00
Onuralp SEZER a790040c84 Merge pull request #910 from LeviVasconcelos/polygonzone-add-multiple-anchors-support
Polygonzone add multiple anchors support
2024-02-28 22:23:54 +03:00
Onuralp SEZER d0ad5fe1d4 fix: 🐞 depricated supervision version add and abbreviation dropped
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-28 22:10:06 +03:00
Piotr Skalski 0c0685987a Merge pull request #942 from roboflow/feat/PolygonZoneAnnotator/LabelVisibility
feat(PolygonZoneAnnotator): ✨ make display of zone label optional default is true
2024-02-28 14:54:55 +01:00
Onuralp SEZER 5f85339851 feat(PolygonZoneAnnotator): ✨ make display of zone label optional default is true
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-28 16:36:31 +03:00
Piotr Skalski 13cb923541 Merge pull request #944 from LinasKo/fix/smoother-removes-detections-tracker-id
Fix smoother removing tracking_id from detections
2024-02-28 14:25:31 +01:00
Linas Kondrackis 5e1d9bbd40 smoother: check len of detections - not tracked_detections 2024-02-28 15:22:15 +02:00
James cb8f4af8bf Merge pull request #955 from roboflow/fix/doc/percentage
fix(docs): 🐞 PercentageBarAnnotator example doc code usage fixed
2024-02-28 12:31:28 +00:00
Onuralp SEZER 165ed424bf fix(docs): 🐞 PercentageBarAnnotator example doc code usage fixed
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-28 15:27:18 +03:00
Onuralp SEZER 96225cda0c Merge pull request #875 from LinasKo/feature/annotators-accept-PIL-images
Decorators around annotate functions, convert PIL images to np.ndarray
2024-02-28 14:34:14 +03:00
Piotr Skalski c039a90053 Merge pull request #952 from roboflow/fix/mask_iou_batch_memory_limit
Bugfix mask_iou_batch memory limit 5MB -> 5GB
2024-02-28 12:18:44 +01:00
PacificDou d9ccbda0a2 change memory limit unit to MB 2024-02-28 10:40:32 +00:00
PacificDou 49d4a4a9fd memory limit 5MB -> 5GB 2024-02-28 09:52:25 +00:00
Onuralp SEZER 97c01aa1a7 Merge pull request #951 from roboflow/dependabot/pip/mkdocstrings-0.24.1
⬆️ Bump mkdocstrings from 0.24.0 to 0.24.1
2024-02-28 03:57:53 +03:00
dependabot[bot] 3f9f87f645 ⬆️ Bump mkdocstrings from 0.24.0 to 0.24.1
Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.24.0 to 0.24.1.
- [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.24.0...0.24.1)

---
updated-dependencies:
- dependency-name: mkdocstrings
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 00:56:45 +00:00
Onuralp SEZER 2ba70f644c Merge branch 'develop' into feature/annotators-accept-PIL-images 2024-02-27 12:51:33 +03:00
Onuralp SEZER fa65d5f34e ci: 👷 minimum pillow and poetry version adjusted for min ver
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-27 12:50:21 +03:00
Onuralp SEZER a9f0154ca3 Merge pull request #949 from roboflow/dependabot/pip/notebook-7.1.1
⬆️ Bump notebook from 7.1.0 to 7.1.1
2024-02-27 12:33:43 +03:00
James b6f67e607e Merge pull request #889 from roboflow/ruff/config-updates
ci: 👷 ruff name rules updated
2024-02-27 09:33:01 +00:00
dependabot[bot] a5bb5a6aa8 ⬆️ Bump notebook from 7.1.0 to 7.1.1
Bumps [notebook](https://github.com/jupyter/notebook) from 7.1.0 to 7.1.1.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.1.0...@jupyter-notebook/tree@7.1.1)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-27 00:19:02 +00:00
Levi Vasconcelos 8b443d1b45 pre-commit
pre-commit
2024-02-26 17:41:58 -03:00
Levi Vasconcelos 61adff2c9a review: fix @deprecated_parameter parameter names 2024-02-26 17:41:10 -03:00
Levi Vasconcelos d4cee86e2b reviews: add custom message option to @deprecated_parameter; add docstring 2024-02-26 17:41:10 -03:00
Levi Vasconcelos cb46751c9a reviews: use test_utils.mock_detections 2024-02-26 17:41:10 -03:00
Levi Vasconcelos 5e7463dc73 reviews: removing test for deprecation 2024-02-26 17:41:10 -03:00
Levi Vasconcelos 9b50c92ec0 pre-commit on tests 2024-02-26 17:41:10 -03:00
Levi Vasconcelos 7ebbcd6c8e add polygon_zone unit tests 2024-02-26 17:41:10 -03:00
Levi Vasconcelos 069f6f22ca pre-commit reformatting
pre-commit reformatting
2024-02-26 17:41:10 -03:00
Levi Vasconcelos 5bfd8429a8 update documentation
add polygon_zone unit tests
2024-02-26 17:41:10 -03:00
Levi Vasconcelos e8ab777dfd add multiple anchors support: use np.all 2024-02-26 17:41:10 -03:00
Levi Vasconcelos d63837181f allow API backward compatibility 2024-02-26 17:41:10 -03:00
Levi Vasconcelos c523fc163a add multiple anchors support
add multiple anchors support

remove old trigger
2024-02-26 17:41:10 -03:00
Linas Kondrackis 2e6e61b778 Re-add Pillow 2024-02-26 21:09:02 +02:00
Linas Kondrackis 4ee56be8a0 Merge branch 'develop' into feature/annotators-accept-PIL-images 2024-02-26 21:01:16 +02:00
Onuralp SEZER e5dfc4c221 Merge pull request #946 from roboflow/dependabot/pip/mkdocs-git-committers-plugin-2-2.3.0
⬆️ Bump mkdocs-git-committers-plugin-2 from 2.2.3 to 2.3.0
2024-02-26 21:15:48 +03:00
Onuralp SEZER 02c1cb001c Merge pull request #945 from roboflow/dependabot/pip/mkdocs-material-9.5.11
⬆️ Bump mkdocs-material from 9.5.10 to 9.5.11
2024-02-26 21:14:08 +03:00
Onuralp SEZER 86a309d255 Merge pull request #947 from roboflow/dependabot/pip/pytest-8.0.2
⬆️ Bump pytest from 8.0.1 to 8.0.2
2024-02-26 21:13:34 +03:00
Linas Kondrackis fefd3386c1 Fix formatting 2024-02-26 20:06:57 +02:00
dependabot[bot] 54a4a3606f ⬆️ Bump pytest from 8.0.1 to 8.0.2
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.1...8.0.2)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 01:50:41 +00:00
dependabot[bot] d8396c10ea ⬆️ Bump mkdocs-git-committers-plugin-2 from 2.2.3 to 2.3.0
Bumps [mkdocs-git-committers-plugin-2](https://github.com/ojacques/mkdocs-git-committers-plugin-2) from 2.2.3 to 2.3.0.
- [Release notes](https://github.com/ojacques/mkdocs-git-committers-plugin-2/releases)
- [Commits](https://github.com/ojacques/mkdocs-git-committers-plugin-2/compare/2.2.3...2.3.0)

---
updated-dependencies:
- dependency-name: mkdocs-git-committers-plugin-2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 01:43:58 +00:00
dependabot[bot] 5255a25f03 ⬆️ Bump mkdocs-material from 9.5.10 to 9.5.11
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.10 to 9.5.11.
- [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.5.10...9.5.11)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 01:37:07 +00:00
Tomasz Wrona ae6021a5b4 Fix indent 2024-02-25 23:33:46 +01:00
Tomasz Wrona f866a11099 Review fixes 2024-02-25 23:32:50 +01:00
Linas Kondrackis afcb77965c Fix smoother removing tracking_id from detections
* Addresses issue #928 matching implementation in ByteTrack,
  but sidestepping the underlying cause outlined in #943.
2024-02-25 20:33:24 +02:00
pre-commit-ci[bot] 451e0200cb fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-23 03:23:20 +00:00
Nick Herrig b0667ce6cb Remove tqdm bar so mkdocs builds 2024-02-22 21:21:53 -06:00
PacificDou b2e085dd21 Merge pull request #938 from roboflow/mask-iou-batch-memory-issue
Limit memory usage for mask_iou_batch
2024-02-22 20:41:40 +01:00
pre-commit-ci[bot] a3a8fcb433 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-22 18:00:04 +00:00
PacificDou 7d46c64628 limit memory usage for mask_iou_batch 2024-02-22 17:54:48 +00:00
pre-commit-ci[bot] 419c9e375b fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-22 02:03:18 +00:00
Nick Herrig 59bfc68b6f Add visuals to object tracking cookbook 2024-02-21 19:56:34 -06:00
Nick Herrig 8383b445f1 Add visualizations to annotate with detections cookbook 2024-02-21 18:10:41 -06:00
Onuralp SEZER 8599345a3c Merge pull request #934 from roboflow/dependabot/pip/cryptography-42.0.4
⬆️ Bump cryptography from 42.0.2 to 42.0.4
2024-02-22 00:19:40 +03:00
Onuralp SEZER 69fadf026b Merge pull request #931 from roboflow/dependabot/pip/nbconvert-7.16.1
⬆️ Bump nbconvert from 7.16.0 to 7.16.1
2024-02-22 00:19:22 +03:00
dependabot[bot] 4b2a9bf607 ⬆️ Bump cryptography from 42.0.2 to 42.0.4
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.2 to 42.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.2...42.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-21 20:49:06 +00:00
Nick Herrig a1d4cb8b33 Center html video, similar to count-object-crossing cookbook 2024-02-21 11:00:18 -06:00
Nick Herrig e9d0635a74 Add video display for supervision asset download example 2024-02-21 10:05:57 -06:00
dependabot[bot] dd07502543 ⬆️ Bump nbconvert from 7.16.0 to 7.16.1
Bumps [nbconvert](https://github.com/jupyter/nbconvert) from 7.16.0 to 7.16.1.
- [Release notes](https://github.com/jupyter/nbconvert/releases)
- [Changelog](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/nbconvert/compare/v7.16.0...v7.16.1)

---
updated-dependencies:
- dependency-name: nbconvert
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-21 00:15:43 +00:00
Onuralp SEZER 56d3e8ef0b Merge pull request #917 from roboflow/dependabot/pip/tox-4.13.0
⬆️ Bump tox from 4.12.1 to 4.13.0
2024-02-20 22:14:26 +03:00
Onuralp SEZER c328cf0469 Merge pull request #918 from roboflow/dependabot/pip/matplotlib-3.7.5
⬆️ Bump matplotlib from 3.7.4 to 3.7.5
2024-02-20 22:14:12 +03:00
Onuralp SEZER e34d274d8f Merge pull request #919 from roboflow/dependabot/pip/ruff-0.2.2
⬆️ Bump ruff from 0.2.1 to 0.2.2
2024-02-20 22:13:54 +03:00
Onuralp SEZER 88f0c68929 Merge pull request #920 from roboflow/dependabot/pip/pytest-8.0.1
⬆️ Bump pytest from 8.0.0 to 8.0.1
2024-02-20 22:13:40 +03:00
Onuralp SEZER 34d73e8847 Merge pull request #924 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-02-20 22:08:52 +03:00
Onuralp SEZER 56a7f8a55f Merge pull request #927 from roboflow/dependabot/pip/mkdocs-material-9.5.10
⬆️ Bump mkdocs-material from 9.5.9 to 9.5.10
2024-02-20 22:08:37 +03:00
dependabot[bot] afacc19236 ⬆️ Bump mkdocs-material from 9.5.9 to 9.5.10
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.9 to 9.5.10.
- [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.5.9...9.5.10)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-20 00:58:56 +00:00
pre-commit-ci[bot] 59ba52fd80 chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.1 → v0.2.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.1...v0.2.2)
2024-02-19 17:48:58 +00:00
Piotr Skalski 5ffb3424f3 Merge pull request #922 from roboflow/cookbooks/style-update
new cookbook z-index fix for author avatar
2024-02-19 12:41:38 +01:00
SkalskiP ac7d36b215 new cookbook z-index fix for author avatar 2024-02-19 12:37:25 +01:00
James cf3a954416 Merge pull request #908 from roboflow/cookbooks/author-avatar-zindex
fix: 🐞 cookbook z-index fix for author avatar
2024-02-19 10:00:45 +00:00
James 6615c553e5 Merge pull request #870 from roboflow/docs/home-page
docs: 📝 h1 title Home removed from index.md
2024-02-19 10:00:21 +00:00
dependabot[bot] 0f36679ac7 ⬆️ Bump pytest from 8.0.0 to 8.0.1
Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.0.0...8.0.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 01:19:38 +00:00
dependabot[bot] 97a986cd11 ⬆️ Bump ruff from 0.2.1 to 0.2.2
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.1 to 0.2.2.
- [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.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 01:09:46 +00:00
dependabot[bot] a21d54fab3 ⬆️ Bump matplotlib from 3.7.4 to 3.7.5
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.7.4 to 3.7.5.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.7.4...v3.7.5)

---
updated-dependencies:
- dependency-name: matplotlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 01:02:38 +00:00
dependabot[bot] b80a88ee25 ⬆️ Bump tox from 4.12.1 to 4.13.0
Bumps [tox](https://github.com/tox-dev/tox) from 4.12.1 to 4.13.0.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/main/docs/changelog.rst)
- [Commits](https://github.com/tox-dev/tox/compare/4.12.1...4.13.0)

---
updated-dependencies:
- dependency-name: tox
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 00:58:49 +00:00
Onuralp SEZER c1c528d378 Merge pull request #914 from roboflow/dependabot/pip/cryptography-42.0.2
⬆️ Bump cryptography from 42.0.0 to 42.0.2
2024-02-17 21:46:06 +03:00
dependabot[bot] 1c1a6236ea ⬆️ Bump cryptography from 42.0.0 to 42.0.2
Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.0 to 42.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.0...42.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-17 00:54:06 +00:00
Leo Ueno ebd86eef32 Update occupancy_analytics.ipynb 2024-02-16 12:47:50 -08:00
Leo Ueno 158471283f Add occupancy analytics cookbook 2024-02-16 12:40:55 -08:00
Piotr Skalski df3f8464b1 Merge pull request #911 from roboflow/cookbooks/zero-shot-object-detection-with-yolo-world
🧑‍🍳 Zero-Shot Object Detection with YOLO-World Cookbook
2024-02-16 14:29:01 +01:00
pre-commit-ci[bot] 8625c7217c fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-16 13:26:34 +00:00
SkalskiP 382b4e0801 🧑‍🍳 Zero-Shot Object Detection with YOLO-World Cookbook 2024-02-16 14:23:20 +01:00
Onuralp SEZER 6d2d0c01a3 fix: 🐞 cookbook z-index fix for author avatar
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-15 20:43:11 +03:00
sansyoandpre-commit-ci[bot] 15b099cb71 Add Support for Center Left,Right Text Position for LabelAnnotator (#905)
* Added Position.CENTER_LEFT
* Added Position.CENTER_RIGHT
---------
Author: sansyo <moutoutan@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-15 18:17:28 +03:00
pre-commit-ci[bot] 4e635ee788 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-15 13:17:56 +00:00
Tomasz Wrona f53e0d8aa5 A new cookbook about alignment evaluation 2024-02-15 14:00:09 +01:00
Onuralp SEZER 6ba9e70b69 Merge pull request #904 from NickHerrig/feature/fix-cookbook
Fix google colab link in object tracking cookbook
2024-02-15 14:20:00 +03:00
Nick Herrig 14771fa326 Fix google colab link in object tracking cookbook 2024-02-14 21:56:33 -06:00
Onuralp SEZER 95398c2a8e Merge pull request #901 from Kadermiyanyedi/add-class-name-to-detection-data
[Detections] - from_inference should include 'class_name' key in Detections.data even if result is empty #837
2024-02-14 23:39:05 +03:00
Kader Miyanyedi 75bb07078c fix(detection): add class name to detection data even if empty
Signed-off-by: Kader Miyanyedi <Kadermiyanyedi@hotmail.com>
2024-02-14 23:36:48 +03:00
Kader Miyanyedi ba7077918d docs(byte_tracker): improve byte track argument doc string descriptions 2024-02-14 21:25:28 +03:00
Onuralp SEZER 6b16970d50 Merge pull request #898 from roboflow/dependabot/pip/notebook-7.1.0
⬆️ Bump notebook from 7.0.8 to 7.1.0
2024-02-14 17:25:25 +03:00
Linas Kondrackis 20b412b7e1 Docs fix: ImageType displayed on multiple lines 2024-02-14 15:42:50 +02:00
Linas Kondrackis 3f965c9121 Remove check-docstring-first from pre-commit hook
* Add docstring for ImageType type
* As discussed in https://github.com/roboflow/supervision/pull/875#issuecomment-1941388238
2024-02-14 13:52:50 +02:00
Linas Kondrackis 08418246c2 Add Pillow dependency, add docsrings for ImageType
* PR #875
2024-02-14 13:52:15 +02:00
dependabot[bot] e1607b4590 ⬆️ Bump notebook from 7.0.8 to 7.1.0
Bumps [notebook](https://github.com/jupyter/notebook) from 7.0.8 to 7.1.0.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.0.8...@jupyter-notebook/tree@7.1.0)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-14 01:12:14 +00:00
Onuralp SEZER be2d75c312 ci: 👷 check-docstring-first removed
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-13 16:06:27 +03:00
Onuralp SEZER a697e71ccd ci: 👷 ruff name rules updated
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-13 15:59:59 +03:00
Christoforos Aristeidou 2a9d4257ba Merge branch 'roboflow:develop' into develop 2024-02-12 22:10:14 +02:00
Christoforos Aristeidou 9ca3c9319d pre-commit spacing correction 2024-02-12 22:08:58 +02:00
Christoforos Aristeidou 379d755a52 description of x,y pixel and trim method 2024-02-12 22:03:57 +02:00
Christoforos Aristeidou d228224f06 completed if else statements for positioning 2024-02-12 21:47:29 +02:00
Onuralp SEZER e3f0ca6937 Merge pull request #885 from roboflow/pre-commit-ci-update-config
chore(pre_commit): ⬆ pre_commit autoupdate
2024-02-12 21:54:20 +03:00
Kader Miyanyedi dafa2a42de refactor(byte_tracker): change byte tracker class argument names to more clear 2024-02-12 21:21:26 +03:00
pre-commit-ci[bot] c96022b97a chore(pre_commit): ⬆ pre_commit autoupdate
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.2.0 → v0.2.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.0...v0.2.1)
2024-02-12 17:38:59 +00:00
Piotr Skalski 899be6a5a4 Merge pull request #884 from roboflow/cookbooks/contributing-guidelines
`CONTRIBUTING.md` updates.
2024-02-12 18:26:21 +01:00
pre-commit-ci[bot] 94b0e9cd22 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-12 17:25:12 +00:00
SkalskiP 8ac3b5f8d2 CONTRIBUTING.md updates. 2024-02-12 18:23:56 +01:00
Christoforos Aristeidou 2863267f30 asdf 2024-02-12 18:33:47 +02:00
Piotr Skalski cebf726997 Merge pull request #883 from roboflow/cookbooks/count-objects-crossing-the-line-3
`Count People Crossing the Line` cookbook updates.
2024-02-12 17:02:18 +01:00
pre-commit-ci[bot] 8ddfcdcd9a fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-12 16:00:48 +00:00
SkalskiP 5997c39ac7 Count People Crossing the Line cookbook updates. 2024-02-12 16:43:40 +01:00
Piotr Skalski 39b5563465 Merge pull request #882 from roboflow/docs/line-zone-docs-improvement
`LineZone`, `LineZoneAnnotator` documentation improvements
2024-02-12 13:53:33 +01:00
pre-commit-ci[bot] 1b07974e93 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-12 12:51:07 +00:00
SkalskiP ba81a09b2c LineZone, LineZoneAnnotator documentation improvements 2024-02-12 13:43:58 +01:00
Onuralp SEZER 2e898f137e Merge pull request #879 from roboflow/dependabot/pip/tqdm-4.66.2
⬆️ Bump tqdm from 4.66.1 to 4.66.2
2024-02-12 15:40:26 +03:00
dependabot[bot] c7e8534650 ⬆️ Bump tqdm from 4.66.1 to 4.66.2
Bumps [tqdm](https://github.com/tqdm/tqdm) from 4.66.1 to 4.66.2.
- [Release notes](https://github.com/tqdm/tqdm/releases)
- [Commits](https://github.com/tqdm/tqdm/compare/v4.66.1...v4.66.2)

---
updated-dependencies:
- dependency-name: tqdm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 10:30:41 +00:00
Onuralp SEZER fd2b3c4e8e Merge pull request #877 from roboflow/dependabot/pip/mkdocs-material-9.5.9
⬆️ Bump mkdocs-material from 9.5.8 to 9.5.9
2024-02-12 13:21:16 +03:00
Onuralp SEZER 632d078f4b Merge pull request #878 from roboflow/dependabot/pip/notebook-7.0.8
⬆️ Bump notebook from 7.0.7 to 7.0.8
2024-02-12 13:20:54 +03:00
Onuralp SEZER cbd77b10f9 Merge pull request #880 from roboflow/dependabot/pip/twine-5.0.0
⬆️ Bump twine from 4.0.2 to 5.0.0
2024-02-12 13:19:54 +03:00
dependabot[bot] 48500cd350 ⬆️ Bump twine from 4.0.2 to 5.0.0
Bumps [twine](https://github.com/pypa/twine) from 4.0.2 to 5.0.0.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/main/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/4.0.2...5.0.0)

---
updated-dependencies:
- dependency-name: twine
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 00:55:18 +00:00
dependabot[bot] ac53125bb6 ⬆️ Bump notebook from 7.0.7 to 7.0.8
Bumps [notebook](https://github.com/jupyter/notebook) from 7.0.7 to 7.0.8.
- [Release notes](https://github.com/jupyter/notebook/releases)
- [Changelog](https://github.com/jupyter/notebook/blob/@jupyter-notebook/tree@7.0.8/CHANGELOG.md)
- [Commits](https://github.com/jupyter/notebook/compare/@jupyter-notebook/tree@7.0.7...@jupyter-notebook/tree@7.0.8)

---
updated-dependencies:
- dependency-name: notebook
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 00:50:34 +00:00
dependabot[bot] 0f2a18efd1 ⬆️ Bump mkdocs-material from 9.5.8 to 9.5.9
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.8 to 9.5.9.
- [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.5.8...9.5.9)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 00:48:54 +00:00
Linas Kondrackis c8f7622e91 Remove ImgType docstring
* Bad decision, but makes the pre-commit hook happy
2024-02-10 16:39:38 +02:00
Linas Kondrackis c2dd5031ba Decorators around annotate functions, convert PIL images to np.ndarray and back, if required 2024-02-10 14:43:00 +02:00
Piotr Skalski 2f9fee6451 Merge pull request #872 from roboflow/cookbooks/count-pople-crossing-the-line-2
[Cookbooks] - Count People Crossing the Line 2
2024-02-09 19:11:55 +01:00
pre-commit-ci[bot] b6dc988e37 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-09 18:10:48 +00:00
SkalskiP 2ea2231324 ready 2024-02-09 19:09:10 +01:00
Piotr Skalski 78d6890508 Merge pull request #869 from roboflow/cookbooks/count-objects-crossing-the-line
[Cookbooks] - Count Objects Crossing the Line
2024-02-09 18:50:57 +01:00
SkalskiP d8584333ef Merge remote-tracking branch 'origin/cookbooks/count-objects-crossing-the-line' into cookbooks/count-objects-crossing-the-line 2024-02-09 18:50:02 +01:00
SkalskiP 69213b19d7 up 2024-02-09 18:49:55 +01:00
Onuralp SEZER 0d312f3cd7 docs: 📝 h1 title Home removed from index.md
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-09 20:17:53 +03:00
SkalskiP 11197f8a4e bump version from 0.19.0rc2 to 0.19.0rc3 2024-02-09 18:09:56 +01:00
pre-commit-ci[bot] 01e7330e6e fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-09 16:57:32 +00:00
SkalskiP 9d71636051 cleaning up Nick's cookbooks 2024-02-09 17:57:18 +01:00
SkalskiP 569157f0f0 Merge remote-tracking branch 'origin/develop' into cookbooks/count-objects-crossing-the-line
# Conflicts:
#	docs/theme/cookbooks.html
2024-02-09 17:43:19 +01:00
Piotr Skalski 8529a3ec18 Merge pull request #861 from NickHerrig/feat/cookbooks
Feat/cookbooks
2024-02-09 17:37:50 +01:00
SkalskiP 115d4492da changing colab names, card names, and card labels 2024-02-09 17:36:13 +01:00
SkalskiP 6cf9ece3a8 initial changes for count objects crossing the line cookbook 2024-02-09 17:25:55 +01:00
Nick Herrig 84b54d31bf Add colab notebook button, test in notebooks 2024-02-09 10:34:40 -05:00
pre-commit-ci[bot] 57c7109498 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-09 14:30:00 +00:00
Nick Herrig 008dbcb0b4 Merge branch 'develop' into feat/cookbooks 2024-02-09 09:29:49 -05:00
Nick Herrig 122ca82cad Update cookbooks html to match new format -> no desc, cap tags 2024-02-09 09:27:07 -05:00
Nick Herrig 9ca7d3eb75 Finish and fix grammar of tracking cookbook 2024-02-09 09:21:14 -05:00
Piotr Skalski 5b2bdf58e7 Merge pull request #868 from roboflow/cookbooks/cards-improvements
[Cookbooks] - Improved functionality of cookbook cards
2024-02-09 14:24:51 +01:00
pre-commit-ci[bot] b7070ae574 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-09 13:23:07 +00:00
SkalskiP 85f09e3323 same label have same color across multiple cards; fixed small bug with hover effect 2024-02-09 14:19:41 +01:00
SkalskiP 03f7001a2b cookbooks-card.js refactor 2024-02-09 13:26:32 +01:00
SkalskiP 36a825b7a0 author styling improvements 2024-02-09 12:47:02 +01:00
Onuralp SEZER 0950f90ddf Merge pull request #867 from roboflow/dependabot/pip/nbconvert-7.16.0
⬆️ Bump nbconvert from 7.14.2 to 7.16.0
2024-02-09 14:22:44 +03:00
Onuralp SEZER cb22b94fe1 Merge pull request #866 from roboflow/dependabot/pip/ipywidgets-8.1.2
⬆️ Bump ipywidgets from 8.1.1 to 8.1.2
2024-02-09 14:22:29 +03:00
pre-commit-ci[bot] 019c41bf1a fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-09 04:37:54 +00:00
Nick Herrig 607d94dad9 Merge branch 'develop' into feat/cookbooks 2024-02-08 23:37:45 -05:00
Nick Herrig aacdbe76f0 Add html entries for cookbooks, add tracking cookbook 2024-02-08 23:27:53 -05:00
Nick Herrig f340c49a70 Update bounding box cookbook name, Fix grammar and spelling 2024-02-08 20:30:57 -05:00
dependabot[bot] 5bd30f4c72 ⬆️ Bump nbconvert from 7.14.2 to 7.16.0
Bumps [nbconvert](https://github.com/jupyter/nbconvert) from 7.14.2 to 7.16.0.
- [Release notes](https://github.com/jupyter/nbconvert/releases)
- [Changelog](https://github.com/jupyter/nbconvert/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jupyter/nbconvert/compare/v7.14.2...v7.16.0)

---
updated-dependencies:
- dependency-name: nbconvert
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 01:04:56 +00:00
dependabot[bot] d0f31448b9 ⬆️ Bump ipywidgets from 8.1.1 to 8.1.2
Bumps [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) from 8.1.1 to 8.1.2.
- [Release notes](https://github.com/jupyter-widgets/ipywidgets/releases)
- [Commits](https://github.com/jupyter-widgets/ipywidgets/compare/8.1.1...8.1.2)

---
updated-dependencies:
- dependency-name: ipywidgets
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-09 01:01:04 +00:00
Nick Herrig 7b4cf2f0f6 Reviewed supervision assets cookbook and renamed 2024-02-08 19:51:08 -05:00
Piotr Skalski fb7dd6aefd Merge pull request #865 from roboflow/cookbooks/html-optimization-and-css-update
cookbooks page HTML optimisation + CSS update
2024-02-08 22:42:00 +01:00
pre-commit-ci[bot] ce70266d23 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-08 21:39:07 +00:00
SkalskiP f1a2b99931 ready for review 2024-02-08 22:36:57 +01:00
Nick Herrig e3adcbeec1 Move cookbooks to new webpage and configure html file 2024-02-08 15:30:32 -05:00
SkalskiP 48af41377f move notebook inside the grid 2024-02-08 20:32:37 +01:00
Nick Herrig 0b7b8bb439 Move assets cookbook to docs, Update theme/cookbooks 2024-02-08 14:13:14 -05:00
Nick Herrig 95d28fabb5 Merge branch 'roboflow:develop' into feat/cookbooks 2024-02-08 13:30:40 -05:00
pre-commit-ci[bot] efd06ac77d fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-08 17:22:01 +00:00
Nick Herrig 1ac497a3e2 Finished bounding box annotation cookbook 2024-02-08 12:20:56 -05:00
Piotr Skalski 3dd3781b1b Add hackfest baner to README.md 2024-02-08 18:20:13 +01:00
Nick Herrig a015fc176e Fix object detection conflicts 2024-02-08 12:18:09 -05:00
Piotr Skalski 775c1b65f8 Merge pull request #863 from roboflow/fix/doc-env2
docs(fix): 🐞📝 MKDOCS_GIT_COMMITTERS_APIKEY fix attempt v2
2024-02-08 17:56:10 +01:00
Onuralp SEZER 8514f086b7 docs(fix): 🐞📝 MKDOCS_GIT_COMMITTERS_APIKEY fix attempt v2
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 19:53:51 +03:00
Nick Herrig 4685a0a2ff Update bounding box conflict 2024-02-08 11:38:14 -05:00
Piotr Skalski a26dd9416e Merge pull request #862 from roboflow/fix/doc-env
docs(fix): 🐞📝 MKDOCS_GIT_COMMITTERS_APIKEY value added
2024-02-08 17:37:57 +01:00
Onuralp SEZER a6466d13a9 docs(fix): 🐞📝 MKDOCS_GIT_COMMITTERS_APIKEY value added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 19:33:20 +03:00
Piotr Skalski 82b18ae3f8 Merge pull request #860 from roboflow/docs/notebooks
docs(page): 🚀 Supervision Cookbook
2024-02-08 17:26:24 +01:00
Onuralp SEZER 08a204d872 docs(api): 📝 api/annotators position adjusted and small typo fix
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 19:20:15 +03:00
Onuralp SEZER 4e5331b92d docs(version): 🐞 restore version part and revert hide h1 on home for now
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 18:57:39 +03:00
Onuralp SEZER 985624e35e docs(assets): 🐞 missing js and css files added into mkdocs.yml
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 18:05:07 +03:00
Onuralp SEZER 6a091b58a8 ci(docs): 👷 GH_TOKEN added for git-committers
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 17:51:19 +03:00
Onuralp SEZER 4ef2d04dec ci(docs): 👷 new packages added for build document
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 17:39:16 +03:00
pre-commit-ci[bot] f81ccbcc5f fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-08 14:34:47 +00:00
Onuralp SEZER d900e68787 docs(home): 🚀 hide table of content for home page only and give looks as more like home of supervision
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 17:33:52 +03:00
Onuralp SEZER ab38cb1531 docs(nb): 🚀 initial notebook added as quickstart and other examples are removed
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 17:30:04 +03:00
pre-commit-ci[bot] 7f51984063 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-08 14:22:52 +00:00
pre-commit-ci[bot] 1ad26b5527 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-08 14:13:38 +00:00
Onuralp SEZER d2ccc4f270 docs(nav): 🚀 nav-tab enabled and new order of pages for better understanding
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 17:13:03 +03:00
Onuralp SEZER 15b4914448 docs(js): 🔥 unused params has been removed from js files for cookbook page
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 17:06:22 +03:00
Onuralp SEZER 3ddeed1945 docs: ✨ data-url param added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 16:48:46 +03:00
Onuralp SEZER 1a20bb5745 docs: ✨ add demo notebook and remove notebooks folder from ignore list
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 16:33:05 +03:00
Onuralp SEZER c4365871b5 Merge changes from develop branch 2024-02-08 15:31:06 +03:00
Onuralp SEZER 1fba192319 docs: ✨ folder rename to javascript to javascripts (plural)
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 15:26:03 +03:00
Onuralp SEZER 6ffd159b77 docs: ✨ supervision cookbook initial page design landed
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-08 15:20:43 +03:00
Onuralp SEZER 16d3214db9 Merge pull request #857 from roboflow/dependabot/pip/mkdocs-material-9.5.8
⬆️ Bump mkdocs-material from 9.5.7 to 9.5.8
2024-02-08 03:41:16 +03:00
dependabot[bot] 381bc8aed6 ⬆️ Bump mkdocs-material from 9.5.7 to 9.5.8
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.5.7 to 9.5.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.5.7...9.5.8)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-08 00:37:30 +00:00
Nick Herrig 3150f5a672 Add rough draft of bounding box displays 2024-02-07 18:55:24 -05:00
Onuralp SEZER eb35fdd1b7 Merge pull request #856 from roboflow/dependabot/pip/ruff-0.2.1
⬆️ Bump ruff from 0.2.0 to 0.2.1
2024-02-08 00:43:46 +03:00
Nick Herrig 9e95e1f0b3 Add supervision assets cookbook, correct assets documentation 2024-02-07 14:56:08 -05:00
Nick Herrig 4bfbe3c8f7 Add readme for cookbooks directory 2024-02-07 14:52:43 -05:00
Onuralp SEZER a6d9961b2b docs: ✨ jupyter notebook support added
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
2024-02-07 20:06:25 +03:00
Piotr Skalski a670faf646 Merge pull request #847 from AdonaiVera/segmentation_nms
[NMS] - add segmentation models support
2024-02-07 10:09:01 +01:00
SkalskiP 824a9140b6 tests fixed 2024-02-07 09:59:58 +01:00
SkalskiP 36ec1b6481 Merge remote-tracking branch 'origin/segmentation_nms' into segmentation_nms 2024-02-07 09:43:20 +01:00
SkalskiP 79a13d0432 final tests 2024-02-07 09:42:56 +01:00
pre-commit-ci[bot] cbbfb453f2 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-07 08:41:34 +00:00
SkalskiP bbe0bfc760 final tests 2024-02-07 09:41:21 +01:00
SkalskiP 98e7310038 test vectorized mask_non_max_suppression 2024-02-07 09:31:02 +01:00
SkalskiP 71836ed1ee Merge remote-tracking branch 'origin/segmentation_nms' into segmentation_nms 2024-02-07 09:28:03 +01:00
SkalskiP b681274954 Merge remote-tracking branch 'origin/segmentation_nms' into segmentation_nms 2024-02-07 09:27:49 +01:00
SkalskiP 619fa832c5 Merge remote-tracking branch 'origin/segmentation_nms' into segmentation_nms 2024-02-07 09:24:55 +01:00
SkalskiP f2e65cf6fc refactored mask_non_max_suppression 2024-02-07 09:24:45 +01:00
pre-commit-ci[bot] 8f6887d994 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-07 08:21:36 +00:00
SkalskiP c46a2e9c08 Merge remote-tracking branch 'origin/segmentation_nms' into segmentation_nms
# Conflicts:
#	supervision/detection/utils.py
2024-02-07 09:21:22 +01:00
SkalskiP 7e44838e51 refactored mask_non_max_suppression 2024-02-07 09:20:54 +01:00
pre-commit-ci[bot] c98dbbf2f6 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-07 08:18:54 +00:00
SkalskiP 239f7333f1 refactored mask_non_max_suppression 2024-02-07 09:18:41 +01:00
SkalskiP 35c9ebdd60 refactored mask_non_max_suppression 2024-02-07 08:51:57 +01:00
pre-commit-ci[bot] 879cf6d9dc fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-07 05:15:10 +00:00
Adonai Vera fd70f3ce5d Applied inclusion-exclusion principle to mask_iou_batch and resize function to improve speed 2024-02-07 00:14:54 -05:00
pre-commit-ci[bot] cf63c838b2 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-06 08:55:15 +00:00
SkalskiP 9ee42e5257 mask_iou_batch speed test 2024-02-06 09:54:07 +01:00
dependabot[bot] 9253da570f ⬆️ Bump ruff from 0.2.0 to 0.2.1
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.2.0 to 0.2.1.
- [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.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-06 01:03:21 +00:00
Christoforos Aristeidou cf14758891 as 2024-02-05 23:46:30 +02:00
pre-commit-ci[bot] 1e87a99259 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-03 03:19:57 +00:00
Adonai Vera ebe2785287 Removed issue of length sentence 2024-02-02 22:19:40 -05:00
pre-commit-ci[bot] aaf3621841 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-02-03 03:10:29 +00:00
Adonai Vera 6a9c013949 Added nms for segmentation algorithm, added unit test, added init, added withnms conditional depends if contains mask 2024-02-02 21:33:15 -05:00
Adonai Vera 8d702ceccd Remove csv file 2024-02-02 12:59:12 -05:00
Adonai Vera f9caa7db66 Change name csv from json 2024-02-02 12:59:12 -05:00
Adonai Vera 6e32cdb55a allowing to serialise Detections to a JSON file 2024-02-02 12:59:12 -05:00
Christoforos Aristeidou fbbf147312 added zoom factor, crop of image part and placement on frame 2024-01-30 02:25:21 +02:00
Christoforos Aristeidou 96b52f28fb added attributes and base for annotate() method 2024-01-29 23:36:20 +02:00
Christoforos Aristeidou c132d5fcf2 added CropAnnotator to __init__() 2024-01-29 22:54:51 +02:00
Christoforos Aristeidou bc24d0ec44 initial doc strings 2024-01-29 22:49:51 +02:00
Christoforos Aristeidou 714937e4bd initial class build 2024-01-29 22:40:33 +02:00
Christoforos Aristeidou c016ea3071 as 2024-01-29 22:38:40 +02:00
pre-commit-ci[bot] 27b61ab4a3 fix(pre_commit): 🎨 auto format pre-commit hooks 2024-01-22 23:31:31 +00:00
Seongjun Choi bddb72fb28 Modify: from_mmdetection add mask. See #703 2024-01-23 15:26:02 +09:00
Seongjun Choi 823dc56057 Modify: from_mmdetection add mask. See #703 2024-01-23 15:14:56 +09:00
mario-dg 6f4704625b Refactored merging of Detection attributes to better work with np.ndarrays 2023-10-19 00:05:42 +02:00
mario-dg 9f222736e1 Added standard full image inference after sliced inference to increase large object detection accuracy 2023-10-19 00:05:05 +02:00
mario-dg 57b12e6e00 Added __setitem__ to Detections and refactored the object prediction merging 2023-10-19 00:03:36 +02:00
mario-dg c78ae33e43 feat: 🚀 Added Non-Maximum Merging to Detections 2023-10-13 18:24:22 +02:00
158 changed files with 19597 additions and 3163 deletions
@@ -4,12 +4,18 @@ on:
push:
branches:
- develop
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref}}
cancel-in-progress: true
permissions:
contents: write
pages: write
pull-requests: write
jobs:
deploy:
runs-on: ubuntu-latest
@@ -21,19 +27,27 @@ jobs:
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version: '3.10'
- name: 📦 Install mkdocs-material
run: pip install mkdocs-material
run: pip install "mkdocs-material"
- name: 📦 Install mkdocstrings[python]
run: pip install "mkdocstrings[python]"
- name: 📦 Install mkdocs-material[imaging]
run: pip install "mkdocs-material[imaging]"
- name: 📦 Install mike
run: pip install "mike"
- name: 📦 Install mkdocs-git-revision-date-localized-plugin
run: pip install "mkdocs-git-revision-date-localized-plugin"
- name: 📦 Install JupyterLab
run: pip install jupyterlab
- name: 📦 Install mkdocs-jupyter
run: pip install mkdocs-jupyter
- name: 📦 Install mkdocs-git-committers-plugin-2
run: pip install mkdocs-git-committers-plugin-2
- name: ⚙️ Configure git for github-actions
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: 🚀 Deploy MkDoc-Material with mike
run: |
mike deploy --push develop
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} mike deploy --push develop
@@ -0,0 +1,55 @@
name: Supervision Release Documentation Workflow 📚
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref}}
cancel-in-progress: true
permissions:
contents: write
pages: write
pull-requests: write
jobs:
doc-build-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.head_ref }}
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 📦 Install mkdocs-material
run: pip install "mkdocs-material"
- name: 📦 Install mkdocstrings[python]
run: pip install "mkdocstrings[python]"
- name: 📦 Install mkdocs-material[imaging]
run: pip install "mkdocs-material[imaging]"
- name: 📦 Install mike
run: pip install "mike"
- name: 📦 Install mkdocs-git-revision-date-localized-plugin
run: pip install "mkdocs-git-revision-date-localized-plugin"
- name: 📦 Install JupyterLab
run: pip install jupyterlab
- name: 📦 Install mkdocs-jupyter
run: pip install mkdocs-jupyter
- name: 📦 Install mkdocs-git-committers-plugin-2
run: pip install mkdocs-git-committers-plugin-2
- name: ⚙️ Configure git for github-actions 👷
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: 🚀 Deploy MkDoc-Material 📚
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
MKDOCS_GIT_COMMITTERS_APIKEY=${{ secrets.GITHUB_TOKEN }} mike deploy --push --update-aliases $latest_tag latest
+8 -6
View File
@@ -6,22 +6,24 @@ on:
- '[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]'
- '[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- name: Checkout source
- name: 🛎️ Checkout
uses: actions/checkout@v4
- name: 🐍 Set up Python 3.8 environment for build
with:
ref: ${{ github.head_ref }}
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: ${{ matrix.python-version }}
- name: 🏗️ Build source and wheel distributions
run: |
+1 -4
View File
@@ -3,10 +3,7 @@ on:
push:
tags:
- '[0-9]+.[0-9]+[0-9]+.[0-9]'
- '[0-9]+.[0-9]+[0-9]+.[0-9]'
- '[0-9]+.[0-9]+[0-9]+.[0-9]'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
@@ -14,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.10"]
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
+34
View File
@@ -0,0 +1,34 @@
name: 🧪 Docs Test WorkFlow 📚
on:
pull_request:
branches: [main, develop]
jobs:
docs-build-test:
runs-on: ubuntu-latest
steps:
- name: 🔄 Checkout code
uses: actions/checkout@v4
- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 📦 Install mkdocs-material
run: pip install "mkdocs-material[all]"
- name: 📦 Install mkdocstrings[python]
run: pip install "mkdocstrings[python]"
- name: 📦 Install mkdocs-material[imaging]
run: pip install "mkdocs-material[imaging]"
- name: 📦 Install mike
run: pip install "mike"
- name: 📦 Install mkdocs-git-revision-date-localized-plugin
run: pip install "mkdocs-git-revision-date-localized-plugin"
- name: 📦 Install JupyterLab
run: pip install jupyterlab
- name: 📦 Install mkdocs-jupyter
run: pip install mkdocs-jupyter
- name: 📦 Install mkdocs-git-committers-plugin-2
run: pip install mkdocs-git-committers-plugin-2
- name: 🧪 Test documentation build
run: mkdocs build --verbose
+1
View File
@@ -37,6 +37,7 @@ jobs:
matplotlib==3.5.0 \
numpy==1.21.2 \
opencv-python==4.5.5.64 \
Pillow==10.1.0 \
packaging==23.2 \
pluggy==1.3.0 \
pyparsing==3.1.1 \
-3
View File
@@ -133,9 +133,6 @@ dmypy.json
# Pyre type checker
.pyre/
# Notebooks
notebooks/
# OSX folder attributes
.DS_Store
.AppleDouble
+3 -5
View File
@@ -7,14 +7,13 @@ ci:
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: test/.*\.py
- id: check-yaml
exclude: mkdocs.yml
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: check-case-conflict
@@ -28,9 +27,8 @@ repos:
- id: mixed-line-ending
- repo: https://github.com/PyCQA/bandit
rev: '1.7.7'
rev: '1.7.8'
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
@@ -47,7 +45,7 @@ repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.0
rev: v0.4.7
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
+14
View File
@@ -112,6 +112,20 @@ To run the documentation, install the project requirements with `poetry install
You can learn more about mkdocs on the [mkdocs website](https://www.mkdocs.org/).
## 🧑‍🍳 cookbooks
We are always looking for new examples and cookbooks to add to the `supervision`
documentation. If you have a use case that you think would be helpful to others, please
submit a PR with your example. Here are some guidelines for submitting a new example:
- Create a new notebook in the [`docs/nodebooks`](https://github.com/roboflow/supervision/tree/develop/docs/notebooks) folder.
- Add a link to the new notebook in [`docs/theme/cookbooks.html`](https://github.com/roboflow/supervision/blob/develop/docs/theme/cookbooks.html). Make sure to add the path to the new notebook, as well as a title, labels, author and supervision version.
- Use the [Count Objects Crossing the Line](https://supervision.roboflow.com/develop/notebooks/count-objects-crossing-the-line/) example as a template for your new example.
- Freeze the version of `supervision` you are using.
- Place an appropriate Open in Colab button at the top of the notebook. You can find an example of such a button in the aforementioned `Count Objects Crossing the Line` cookbook.
- Notebook should be self-contained. If you rely on external data ( videos, images, etc.) or libraries, include download and installation commands in the notebook.
- Annotate the code with appropriate comments, including links to the documentation describing each of the tools you have used.
## 🧪 tests
[`pytests`](https://docs.pytest.org/en/7.1.x/) is used to run our tests.
+25 -20
View File
@@ -1,6 +1,6 @@
<div align="center">
<p>
<a align="center" href="" target="_blank">
<a align="center" href="" target="https://supervision.roboflow.com">
<img
width="100%"
src="https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png?updatedAt=1678995927529"
@@ -10,7 +10,7 @@
<br>
[notebooks](https://github.com/roboflow/notebooks) | [inference](https://github.com/roboflow/inference) | [autodistill](https://github.com/autodistill/autodistill) | [collect](https://github.com/roboflow/roboflow-collect)
[notebooks](https://github.com/roboflow/notebooks) | [inference](https://github.com/roboflow/inference) | [autodistill](https://github.com/autodistill/autodistill) | [maestro](https://github.com/roboflow/multimodal-maestro)
<br>
@@ -18,16 +18,18 @@
[![downloads](https://img.shields.io/pypi/dm/supervision)](https://pypistats.org/packages/supervision)
[![license](https://img.shields.io/pypi/l/supervision)](https://github.com/roboflow/supervision/blob/main/LICENSE.md)
[![python-version](https://img.shields.io/pypi/pyversions/supervision)](https://badge.fury.io/py/supervision)
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb)
[![Gradio](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Roboflow/Annotators)
[![Discord](https://img.shields.io/discord/1159501506232451173)](https://discord.gg/GbfgXGJ8Bk)
[![colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb)
[![gradio](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/Roboflow/Annotators)
[![discord](https://img.shields.io/discord/1159501506232451173)](https://discord.gg/GbfgXGJ8Bk)
[![built-with-material-for-mkdocs](https://img.shields.io/badge/Material_for_MkDocs-526CFE?logo=MaterialForMkDocs&logoColor=white)](https://squidfunk.github.io/mkdocs-material/)
</div>
## 👋 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! 🤝
[![supervision-hackfest](https://github.com/roboflow/supervision/assets/26109316/c05cc954-b9a6-4ed5-9a52-d0b4b619ff65)](https://github.com/orgs/roboflow/projects/10)
## 💻 install
Pip install the supervision package in a
@@ -37,7 +39,7 @@ Pip install the supervision package in a
pip install supervision
```
Read more about desktop, headless, and local installation in our [guide](https://roboflow.github.io/supervision/).
Read more about conda, mamba, and installing from source in our [guide](https://roboflow.github.io/supervision/).
## 🔥 quickstart
@@ -69,16 +71,15 @@ len(detections)
```python
import cv2
import supervision as sv
from inference.models.utils import get_roboflow_model
from inference import get_model
image = cv2.imread(...)
model = get_roboflow_model(model_id="yolov8s-640", api_key=<ROBOFLOW API KEY>)
model = get_model(model_id="yolov8s-640", api_key=<ROBOFLOW API KEY>)
result = model.infer(image)[0]
detections = sv.Detections.from_inference(result)
len(detections)
# 5
# 5
```
</details>
@@ -215,19 +216,23 @@ len(dataset)
## 🎬 tutorials
<p align="left">
<a href="https://youtu.be/uWP6UjDeZvY" title="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source"><img src="https://github.com/SkalskiP/SkalskiP/assets/26109316/61a444c8-b135-48ce-b979-2a5ab47c5a91" alt="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source" width="300px" align="left" /></a>
<a href="https://youtu.be/uWP6UjDeZvY" title="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source"><strong>Speed Estimation & Vehicle Tracking | Computer Vision | Open Source</strong></a>
<div><strong>Created: 11 Jan 2024</strong> | <strong>Updated: 11 Jan 2024</strong></div>
<br/> Learn how to track and estimate the speed of vehicles using YOLO, ByteTrack, and Roboflow Inference. This comprehensive tutorial covers object detection, multi-object tracking, filtering detections, perspective transformation, speed estimation, visualization improvements, and more.</p>
Want to learn how to use Supervision? Explore our [how-to guides](https://supervision.roboflow.com/develop/how_to/detect_and_annotate/), [end-to-end examples](https://github.com/roboflow/supervision/tree/develop/examples), and [cookbooks](https://supervision.roboflow.com/develop/cookbooks/)!
<br/>
<p align="left">
<a href="https://youtu.be/4Q3ut7vqD5o" title="Traffic Analysis with YOLOv8 and ByteTrack - Vehicle Detection and Tracking"><img src="https://github.com/roboflow/supervision/assets/26109316/54afdf1c-218c-4451-8f12-627fb85f1682" alt="Traffic Analysis with YOLOv8 and ByteTrack - Vehicle Detection and Tracking" width="300px" align="left" /></a>
<a href="https://youtu.be/4Q3ut7vqD5o" title="Traffic Analysis with YOLOv8 and ByteTrack - Vehicle Detection and Tracking"><strong>Traffic Analysis with YOLOv8 and ByteTrack - Vehicle Detection and Tracking</strong></a>
<div><strong>Created: 6 Sep 2023</strong> | <strong>Updated: 6 Sep 2023</strong></div>
<br/> In this video, we explore real-time traffic analysis using YOLOv8 and ByteTrack to detect and track vehicles on aerial images. Harnessing the power of Python and Supervision, we delve deep into assigning cars to specific entry zones and understanding their direction of movement. By visualizing their paths, we gain insights into traffic flow across bustling roundabouts... </p>
<a href="https://youtu.be/hAWpsIuem10" title="Dwell Time Analysis with Computer Vision | Real-Time Stream Processing"><img src="https://github.com/SkalskiP/SkalskiP/assets/26109316/a742823d-c158-407d-b30f-063a5d11b4e1" alt="Dwell Time Analysis with Computer Vision | Real-Time Stream Processing" width="300px" align="left" /></a>
<a href="https://youtu.be/hAWpsIuem10" title="Dwell Time Analysis with Computer Vision | Real-Time Stream Processing"><strong>Dwell Time Analysis with Computer Vision | Real-Time Stream Processing</strong></a>
<div><strong>Created: 5 Apr 2024</strong></div>
<br/>Learn how to use computer vision to analyze wait times and optimize processes. This tutorial covers object detection, tracking, and calculating time spent in designated zones. Use these techniques to improve customer experience in retail, traffic management, or other scenarios.</p>
<br/>
<p align="left">
<a href="https://youtu.be/uWP6UjDeZvY" title="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source"><img src="https://github.com/SkalskiP/SkalskiP/assets/26109316/61a444c8-b135-48ce-b979-2a5ab47c5a91" alt="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source" width="300px" align="left" /></a>
<a href="https://youtu.be/uWP6UjDeZvY" title="Speed Estimation & Vehicle Tracking | Computer Vision | Open Source"><strong>Speed Estimation & Vehicle Tracking | Computer Vision | Open Source</strong></a>
<div><strong>Created: 11 Jan 2024</strong></div>
<br/>Learn how to track and estimate the speed of vehicles using YOLO, ByteTrack, and Roboflow Inference. This comprehensive tutorial covers object detection, multi-object tracking, filtering detections, perspective transformation, speed estimation, visualization improvements, and more.</p>
## 💜 built with supervision
Vendored
+1294 -1292
View File
File diff suppressed because one or more lines are too long
+4 -5
View File
@@ -7,8 +7,7 @@ comments: true
Supervision offers an assets download utility that allows you to download video files
that you can use in your demos.
## install extra
## Install extra
To install the Supervision assets utility, you can use `pip`. This utility is available
as an extra within the Supervision package.
@@ -16,17 +15,17 @@ as an extra within the Supervision package.
!!! example "pip install"
```bash
pip install supervision[assets]
pip install "supervision[assets]"
```
<div class="md-typeset">
<h2>download_assets</h2>
<h2><a href="#supervision.assets.downloader.download_assets.download_assets">download_assets</a></h2>
</div>
:::supervision.assets.downloader.download_assets
<div class="md-typeset">
<h2>VideoAssets</h2>
<h2><a href="#supervision.assets.downloader.download_assets.VideoAssets">VideoAssets</a></h2>
</div>
:::supervision.assets.list.VideoAssets
+228 -1
View File
@@ -1,6 +1,233 @@
### 0.21.0 <small>Jun 5, 2024</small>
- Added [#500](https://github.com/roboflow/supervision/pull/500): [`sv.Detections.with_nmm`](https://supervision.roboflow.com/develop/detection/core/#supervision.detection.core.Detections.with_nmm) to perform non-maximum merging on the current set of object detections.
- Added [#1221](https://github.com/roboflow/supervision/pull/1221): [`sv.Detections.from_lmm`](https://supervision.roboflow.com/develop/detection/core/#supervision.detection.core.Detections.from_lmm) allowing to parse Large Multimodal Model (LMM) text result into [`sv.Detections`](https://supervision.roboflow.com/develop/detection/core/) object. For now `from_lmm` supports only [PaliGemma](https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-finetune-paligemma-on-detection-dataset.ipynb) result parsing.
```python
import supervision as sv
paligemma_result = "<loc0256><loc0256><loc0768><loc0768> cat"
detections = sv.Detections.from_lmm(
sv.LMM.PALIGEMMA,
paligemma_result,
resolution_wh=(1000, 1000),
classes=['cat', 'dog']
)
detections.xyxy
# array([[250., 250., 750., 750.]])
detections.class_id
# array([0])
```
- Added [#1236](https://github.com/roboflow/supervision/pull/1236): [`sv.VertexLabelAnnotator`](https://supervision.roboflow.com/develop/keypoint/annotators/#supervision.keypoint.annotators.EdgeAnnotator.annotate) allowing to annotate every vertex of a keypoint skeleton with custom text and color.
```python
import supervision as sv
image = ...
key_points = sv.KeyPoints(...)
edge_annotator = sv.EdgeAnnotator(
color=sv.Color.GREEN,
thickness=5
)
annotated_frame = edge_annotator.annotate(
scene=image.copy(),
key_points=key_points
)
```
- Added [#1147](https://github.com/roboflow/supervision/pull/1147): [`sv.KeyPoints.from_inference`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints.from_inference) allowing to create [`sv.KeyPoints`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints) from [Inference](https://github.com/roboflow/inference) result.
- Added [#1138](https://github.com/roboflow/supervision/pull/1138): [`sv.KeyPoints.from_yolo_nas`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints.from_yolo_nas) allowing to create [`sv.KeyPoints`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints) from [YOLO-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md) result.
- Added [#1163](https://github.com/roboflow/supervision/pull/1163): [`sv.mask_to_rle`](https://supervision.roboflow.com/develop/datasets/utils/#supervision.dataset.utils.rle_to_mask) and [`sv.rle_to_mask`](https://supervision.roboflow.com/develop/datasets/utils/#supervision.dataset.utils.rle_to_mask) allowing for easy conversion between mask and rle formats.
- Changed [#1236](https://github.com/roboflow/supervision/pull/1236): [`sv.InferenceSlicer`](https://supervision.roboflow.com/develop/detection/tools/inference_slicer/) allowing to select overlap filtering strategy (`NONE`, `NON_MAX_SUPPRESSION` and `NON_MAX_MERGE`).
- Changed [#1178](https://github.com/roboflow/supervision/pull/1178): [`sv.InferenceSlicer`](https://supervision.roboflow.com/develop/detection/tools/inference_slicer/) adding instance segmentation model support.
```python
import cv2
import numpy as np
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8x-seg-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
def callback(image_slice: np.ndarray) -> sv.Detections:
results = model.infer(image_slice)[0]
return sv.Detections.from_inference(results)
slicer = sv.InferenceSlicer(callback = callback)
detections = slicer(image)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
- Changed [#1228](https://github.com/roboflow/supervision/pull/1228): [`sv.LineZone`](https://supervision.roboflow.com/develop/detection/tools/line_zone/) making it 10-20 times faster, depending on the use case.
- Changed [#1163](https://github.com/roboflow/supervision/pull/1163): [`sv.DetectionDataset.from_coco`](https://supervision.roboflow.com/develop/datasets/core/#supervision.dataset.core.DetectionDataset.from_coco) and [`sv.DetectionDataset.as_coco`](https://supervision.roboflow.com/develop/datasets/core/#supervision.dataset.core.DetectionDataset.as_coco) adding support for run-length encoding (RLE) mask format.
### 0.20.0 <small>April 24, 2024</small>
- Added [#1128](https://github.com/roboflow/supervision/pull/1128): [`sv.KeyPoints`](/0.20.0/keypoint/core/#supervision.keypoint.core.KeyPoints) to provide initial support for pose estimation and broader keypoint detection models.
- Added [#1128](https://github.com/roboflow/supervision/pull/1128): [`sv.EdgeAnnotator`](/0.20.0/keypoint/annotators/#supervision.keypoint.annotators.EdgeAnnotator) and [`sv.VertexAnnotator`](/0.20.0/keypoint/annotators/#supervision.keypoint.annotators.VertexAnnotator) to enable rendering of results from keypoint detection models.
```python
import cv2
import supervision as sv
from ultralytics import YOLO
image = cv2.imread(<SOURCE_IMAGE_PATH>)
model = YOLO('yolov8l-pose')
result = model(image, verbose=False)[0]
keypoints = sv.KeyPoints.from_ultralytics(result)
edge_annotators = sv.EdgeAnnotator(color=sv.Color.GREEN, thickness=5)
annotated_image = edge_annotators.annotate(image.copy(), keypoints)
```
- Changed [#1037](https://github.com/roboflow/supervision/pull/1037): [`sv.LabelAnnotator`](/0.20.0/annotators/#supervision.annotators.core.LabelAnnotator) by adding an additional `corner_radius` argument that allows for rounding the corners of the bounding box.
- Changed [#1109](https://github.com/roboflow/supervision/pull/1109): [`sv.PolygonZone`](/0.20.0/detection/tools/polygon_zone/#supervision.detection.tools.polygon_zone.PolygonZone) such that the `frame_resolution_wh` argument is no longer required to initialize `sv.PolygonZone`.
!!! failure "Deprecated"
The `frame_resolution_wh` parameter in `sv.PolygonZone` is deprecated and will be removed in `supervision-0.24.0`.
- Changed [#1084](https://github.com/roboflow/supervision/pull/1084): [`sv.get_polygon_center`](/0.20.0/utils/geometry/#supervision.geometry.core.utils.get_polygon_center) to calculate a more accurate polygon centroid.
- Changed [#1069](https://github.com/roboflow/supervision/pull/1069): [`sv.Detections.from_transformers`](/0.20.0/detection/core/#supervision.detection.core.Detections.from_transformers) by adding support for Transformers segmentation models and extract class names values.
```python
import torch
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForSegmentation
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50-panoptic")
model = DetrForSegmentation.from_pretrained("facebook/detr-resnet-50-panoptic")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_segmentation(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(results, id2label=model.config.id2label)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator(text_position=sv.Position.CENTER)
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
- Fixed [#787](https://github.com/roboflow/supervision/pull/787): [`sv.ByteTrack.update_with_detections`](/0.20.0/trackers/#supervision.tracker.byte_tracker.core.ByteTrack.update_with_detections) which was removing segmentation masks while tracking. Now, `ByteTrack` can be used alongside segmentation models.
### 0.19.0 <small>March 15, 2024</small>
- Added [#818](https://github.com/roboflow/supervision/pull/818): [`sv.CSVSink`](/0.19.0/detection/tools/save_detections/#supervision.detection.tools.csv_sink.CSVSink) allowing for the straightforward saving of image, video, or stream inference results in a `.csv` file.
```python
import supervision as sv
from ultralytics import YOLO
model = YOLO(<SOURCE_MODEL_PATH>)
csv_sink = sv.CSVSink(<RESULT_CSV_FILE_PATH>)
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with csv_sink:
for frame in frames_generator:
result = model(frame)[0]
detections = sv.Detections.from_ultralytics(result)
csv_sink.append(detections, custom_data={<CUSTOM_LABEL>:<CUSTOM_DATA>})
```
- Added [#819](https://github.com/roboflow/supervision/pull/819): [`sv.JSONSink`](/0.19.0/detection/tools/save_detections/#supervision.detection.tools.csv_sink.JSONSink) allowing for the straightforward saving of image, video, or stream inference results in a `.json` file.
```python
```python
import supervision as sv
from ultralytics import YOLO
model = YOLO(<SOURCE_MODEL_PATH>)
json_sink = sv.JSONSink(<RESULT_JSON_FILE_PATH>)
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with json_sink:
for frame in frames_generator:
result = model(frame)[0]
detections = sv.Detections.from_ultralytics(result)
json_sink.append(detections, custom_data={<CUSTOM_LABEL>:<CUSTOM_DATA>})
```
- Added [#847](https://github.com/roboflow/supervision/pull/847): [`sv.mask_iou_batch`](/0.19.0/detection/utils/#supervision.detection.utils.mask_iou_batch) allowing to compute Intersection over Union (IoU) of two sets of masks.
- Added [#847](https://github.com/roboflow/supervision/pull/847): [`sv.mask_non_max_suppression`](/0.19.0/detection/utils/#supervision.detection.utils.mask_non_max_suppression) allowing to perform Non-Maximum Suppression (NMS) on segmentation predictions.
- Added [#888](https://github.com/roboflow/supervision/pull/888): [`sv.CropAnnotator`](/0.19.0/annotators/#supervision.annotators.core.CropAnnotator) allowing users to annotate the scene with scaled-up crops of detections.
```python
import cv2
import supervision as sv
from inference import get_model
image = cv2.imread(<SOURCE_IMAGE_PATH>)
model = get_model(model_id="yolov8n-640")
result = model.infer(image)[0]
detections = sv.Detections.from_inference(result)
crop_annotator = sv.CropAnnotator()
annotated_frame = crop_annotator.annotate(
scene=image.copy(),
detections=detections
)
```
- Changed [#827](https://github.com/roboflow/supervision/pull/827): [`sv.ByteTrack.reset`](/0.19.0/tracking/#supervision.tracking.ByteTrack.reset) allowing users to clear trackers state, enabling the processing of multiple video files in sequence.
- Changed [#802](https://github.com/roboflow/supervision/pull/802): [`sv.LineZoneAnnotator`](/0.19.0/detection/tools/line_zone/#supervision.detection.line_zone.LineZone) allowing to hide in/out count using `display_in_count` and `display_out_count` properties.
- Changed [#787](https://github.com/roboflow/supervision/pull/787): [`sv.ByteTrack`](/0.19.0/tracking/#supervision.tracking.ByteTrack) input arguments and docstrings updated to improve readability and ease of use.
!!! failure "Deprecated"
The `track_buffer`, `track_thresh`, and `match_thresh` parameters in `sv.ByterTrack` are deprecated and will be removed in `supervision-0.23.0`. Use `lost_track_buffer,` `track_activation_threshold`, and `minimum_matching_threshold` instead.
- Changed [#910](https://github.com/roboflow/supervision/pull/910): [`sv.PolygonZone`](/0.19.0/detection/tools/polygon_zone/#supervision.detection.tools.polygon_zone.PolygonZone) to now accept a list of specific box anchors that must be in zone for a detection to be counted.
!!! failure "Deprecated"
The `triggering_position ` parameter in `sv.PolygonZone` is deprecated and will be removed in `supervision-0.23.0`. Use `triggering_anchors` instead.
- Changed [#875](https://github.com/roboflow/supervision/pull/875): annotators adding support for Pillow images. All supervision Annotators can now accept an image as either a numpy array or a Pillow Image. They automatically detect its type, draw annotations, and return the output in the same format as the input.
- Fixed [#944](https://github.com/roboflow/supervision/pull/944): [`sv.DetectionsSmoother`](/0.19.0/detection/tools/smoother/#supervision.detection.tools.smoother.DetectionsSmoother) removing `tracking_id` from `sv.Detections`.
### 0.18.0 <small>January 25, 2024</small>
- Added [#633](https://github.com/roboflow/supervision/pull/720): [`sv.PercentageBarAnnotator`](0.18.0/annotators/#percentagebarannotator) allowing to annotate images and videos with percentage values representing confidence or other custom property.
- Added [#720](https://github.com/roboflow/supervision/pull/720): [`sv.PercentageBarAnnotator`](/0.18.0/annotators/#percentagebarannotator) allowing to annotate images and videos with percentage values representing confidence or other custom property.
```python
>>> import supervision as sv
+7
View File
@@ -0,0 +1,7 @@
---
template: cookbooks.html
comments: true
hide:
- navigation
- toc
---
@@ -1,5 +1,6 @@
---
comments: true
status: new
---
# Datasets
+18
View File
@@ -0,0 +1,18 @@
---
comments: true
status: new
---
# Datasets Utils
<div class="md-typeset">
<h2><a href="#supervision.dataset.utils.rle_to_mask">rle_to_mask</a></h2>
</div>
:::supervision.dataset.utils.rle_to_mask
<div class="md-typeset">
<h2><a href="#supervision.dataset.utils.mask_to_rle">mask_to_rle</a></h2>
</div>
:::supervision.dataset.utils.mask_to_rle
+11 -8
View File
@@ -6,11 +6,14 @@ status: deprecated
These features are phased out due to better alternatives or potential issues in future versions. Deprecated functionalities are supported for **three subsequent releases**, providing time for users to transition to updated methods.
- [`Detections.from_froboflow`](detection/core.md/#supervision.detection.core.Detections.from_roboflow) is deprecated and will be removed in `supervision-0.22.0`. Use [`Detections.from_inference`](detection/core.md/#supervision.detection.core.Detections.from_inference) instead.
- `Color.white()` is deprecated and will be removed in `supervision-0.22.0`. Use `Color.WHITE` instead.
- `Color.black()` is deprecated and will be removed in `supervision-0.22.0`. Use `Color.BLACK` instead.
- `Color.red()` is deprecated and will be removed in `supervision-0.22.0`. Use `Color.RED` instead.
- `Color.green()` is deprecated and will be removed in `supervision-0.22.0`. Use `Color.GREEN` instead.
- `Color.blue()` is deprecated and will be removed in `supervision-0.22.0`. Use `Color.BLUE` instead.
- [`ColorPalette.default()`](draw/color.md/#supervision.draw.color.ColorPalette.default) is deprecated and will be removed in `supervision-0.22.0`. Use [`ColorPalette.DEFAULT`](draw/color.md/#supervision.draw.color.ColorPalette.DEFAULT) instead.
- `BoxAnnotator` is deprecated and will be removed in `supervision-0.22.0`. Use [`BoundingBoxAnnotator`](annotators.md/#supervision.annotators.core.BoundingBoxAnnotator) and [`LabelAnnotator`](annotators.md/#supervision.annotators.core.LabelAnnotator) instead.
- [`FPSMonitor.__call__`](utils/video.md/#supervision.utils.video.FPSMonitor.__call__) is deprecated and will be removed in `supervision-0.22.0`. Use [`FPSMonitor.fps`](utils/video.md/#supervision.utils.video.FPSMonitor.fps) instead.
- The method `Color.white()` is deprecated and will be removed in `supervision-0.22.0`. Use the constant `Color.WHITE` instead.
- The method `Color.black()` is deprecated and will be removed in `supervision-0.22.0`. Use the constant `Color.BLACK` instead.
- The method `Color.red()` is deprecated and will be removed in `supervision-0.22.0`. Use the constant `Color.RED` instead.
- The method `Color.green()` is deprecated and will be removed in `supervision-0.22.0`. Use the constant `Color.GREEN` instead.
- The method `Color.blue()` is deprecated and will be removed in `supervision-0.22.0`. Use the constant `Color.BLUE` instead.
- The method [`ColorPalette.default()`](draw/color.md/#supervision.draw.color.ColorPalette.default) is deprecated and will be removed in `supervision-0.22.0`. Use the constant [`ColorPalette.DEFAULT`](draw/color.md/#supervision.draw.color.ColorPalette.DEFAULT) instead.
- `BoxAnnotator` is deprecated and will be removed in `supervision-0.22.0`. Use [`BoundingBoxAnnotator`](detection/annotators.md/#supervision.annotators.core.BoundingBoxAnnotator) and [`LabelAnnotator`](detection/annotators.md/#supervision.annotators.core.LabelAnnotator) instead.
- The method [`FPSMonitor.__call__`](utils/video.md/#supervision.utils.video.FPSMonitor.__call__) is deprecated and will be removed in `supervision-0.22.0`. Use the attribute [`FPSMonitor.fps`](utils/video.md/#supervision.utils.video.FPSMonitor.fps) instead.
- The `track_buffer`, `track_thresh`, and `match_thresh` parameters in [`ByterTrack`](trackers.md/#supervision.tracker.byte_tracker.core.ByteTrack) are deprecated and will be removed in `supervision-0.23.0`. Use `lost_track_buffer,` `track_activation_threshold`, and `minimum_matching_threshold` instead.
- The `triggering_position ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) is deprecated and will be removed in `supervision-0.23.0`. Use `triggering_anchors ` instead.
- The `frame_resolution_wh ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) is deprecated and will be removed in `supervision-0.24.0`.
@@ -1,6 +1,5 @@
---
comments: true
status: new
---
# Annotators
@@ -260,15 +259,22 @@ status: new
=== "Label"
```python
import supervision as sv
import supervision as sv
image = ...
detections = sv.Detections(...)
labels = [
f"{class_name} {confidence:.2f}"
for class_name, confidence
in zip(detections['class_name'], detections.confidence)
]
label_annotator = sv.LabelAnnotator(text_position=sv.Position.CENTER)
annotated_frame = label_annotator.annotate(
scene=image.copy(),
detections=detections
detections=detections,
labels=labels
)
```
@@ -278,6 +284,52 @@ status: new
</div>
=== "RichLabel"
```python
import supervision as sv
image = ...
detections = sv.Detections(...)
labels = [
f"{class_name} {confidence:.2f}"
for class_name, confidence
in zip(detections['class_name'], detections.confidence)
]
rich_label_annotator = sv.RichLabelAnnotator(
font_path=".../font.ttf",
text_position=sv.Position.CENTER
)
annotated_frame = label_annotator.annotate(
scene=image.copy(),
detections=detections,
labels=labels
)
```
<div class="result" markdown>
![label-annotator-example](https://media.roboflow.com/supervision-annotator-examples/label-annotator-example-purple.png){ align=center width="800" }
</div>
=== "Crop"
```python
import supervision as sv
image = ...
detections = sv.Detections(...)
crop_annotator = sv.CropAnnotator()
annotated_frame = crop_annotator.annotate(
scene=image.copy(),
detections=detections
)
```
=== "Blur"
```python
@@ -470,6 +522,12 @@ status: new
:::supervision.annotators.core.LabelAnnotator
<div class="md-typeset">
<h2><a href="#supervision.annotators.core.RichLabelAnnotator">RichLabelAnnotator</a></h2>
</div>
:::supervision.annotators.core.RichLabelAnnotator
<div class="md-typeset">
<h2><a href="#supervision.annotators.core.BlurAnnotator">BlurAnnotator</a></h2>
</div>
@@ -488,6 +546,12 @@ status: new
:::supervision.annotators.core.TraceAnnotator
<div class="md-typeset">
<h2><a href="#supervision.annotators.core.CropAnnotator">CropAnnotator</a></h2>
</div>
:::supervision.annotators.core.CropAnnotator
<div class="md-typeset">
<h2><a href="#supervision.annotators.core.ColorLookup">ColorLookup</a></h2>
</div>
+30
View File
@@ -0,0 +1,30 @@
---
comments: true
status: new
---
# Double Detection Filter
<div class="md-typeset">
<h2><a href="#supervision.detection.overlap_filter.OverlapFilter">OverlapFilter</a></h2>
</div>
:::supervision.detection.overlap_filter.OverlapFilter
<div class="md-typeset">
<h2><a href="#supervision.detection.overlap_filter.box_non_max_suppression">box_non_max_suppression</a></h2>
</div>
:::supervision.detection.overlap_filter.box_non_max_suppression
<div class="md-typeset">
<h2><a href="#supervision.detection.overlap_filter.mask_non_max_suppression">mask_non_max_suppression</a></h2>
</div>
:::supervision.detection.overlap_filter.mask_non_max_suppression
<div class="md-typeset">
<h2><a href="#supervision.detection.overlap_filter.box_non_max_merge">box_non_max_merge</a></h2>
</div>
:::supervision.detection.overlap_filter.box_non_max_merge
+17
View File
@@ -0,0 +1,17 @@
---
comments: true
---
# Metrics
<div class="md-typeset">
<h2><a href="#supervision.metrics.detection.ConfusionMatrix">ConfusionMatrix</a></h2>
</div>
:::supervision.metrics.detection.ConfusionMatrix
<div class="md-typeset">
<h2><a href="#supervision.metrics.detection.MeanAveragePrecision">MeanAveragePrecision</a></h2>
</div>
:::supervision.metrics.detection.MeanAveragePrecision
+1
View File
@@ -1,5 +1,6 @@
---
comments: true
status: new
---
# InferenceSlicer
+11 -2
View File
@@ -1,7 +1,16 @@
---
comments: true
status: new
---
# LineZone
<div class="md-typeset">
<h2>LineZone</h2>
</div>
:::supervision.detection.line_counter.LineZone
:::supervision.detection.line_zone.LineZone
<div class="md-typeset">
<h2>LineZoneAnnotator</h2>
</div>
:::supervision.detection.line_zone.LineZoneAnnotator
+3 -1
View File
@@ -2,7 +2,9 @@
comments: true
---
# PolygonZone
<div class="md-typeset">
<h2>PolygonZone</h2>
</div>
:::supervision.detection.tools.polygon_zone.PolygonZone
+6 -1
View File
@@ -1,6 +1,5 @@
---
comments: true
status: new
---
# Save Detections
@@ -10,3 +9,9 @@ status: new
</div>
:::supervision.detection.tools.csv_sink.CSVSink
<div class="md-typeset">
<h2>JSON Sink</h2>
</div>
:::supervision.detection.tools.json_sink.JSONSink
-1
View File
@@ -1,6 +1,5 @@
---
comments: true
status: new
---
# Detection Smoother
+40 -10
View File
@@ -5,55 +5,85 @@ comments: true
# Detection Utils
<div class="md-typeset">
<h2>box_iou_batch</h2>
<h2><a href="#supervision.detection.utils.box_iou_batch">box_iou_batch</a></h2>
</div>
:::supervision.detection.utils.box_iou_batch
<div class="md-typeset">
<h2>non_max_suppression</h2>
<h2><a href="#supervision.detection.utils.mask_iou_batch">mask_iou_batch</a></h2>
</div>
:::supervision.detection.utils.non_max_suppression
:::supervision.detection.utils.mask_iou_batch
<div class="md-typeset">
<h2>polygon_to_mask</h2>
<h2><a href="#supervision.detection.utils.polygon_to_mask">polygon_to_mask</a></h2>
</div>
:::supervision.detection.utils.polygon_to_mask
<div class="md-typeset">
<h2>mask_to_xyxy</h2>
<h2><a href="#supervision.detection.utils.mask_to_xyxy">mask_to_xyxy</a></h2>
</div>
:::supervision.detection.utils.mask_to_xyxy
<div class="md-typeset">
<h2>mask_to_polygons</h2>
<h2><a href="#supervision.detection.utils.mask_to_polygons">mask_to_polygons</a></h2>
</div>
:::supervision.detection.utils.mask_to_polygons
<div class="md-typeset">
<h2>polygon_to_xyxy</h2>
<h2><a href="#supervision.detection.utils.polygon_to_xyxy">polygon_to_xyxy</a></h2>
</div>
:::supervision.detection.utils.polygon_to_xyxy
<div class="md-typeset">
<h2>filter_polygons_by_area</h2>
<h2><a href="#supervision.detection.utils.filter_polygons_by_area">filter_polygons_by_area</a></h2>
</div>
:::supervision.detection.utils.filter_polygons_by_area
<div class="md-typeset">
<h2>move_boxes</h2>
<h2><a href="#supervision.detection.utils.move_boxes">move_boxes</a></h2>
</div>
:::supervision.detection.utils.move_boxes
<div class="md-typeset">
<h2>scale_boxes</h2>
<h2><a href="#supervision.detection.utils.move_masks">move_masks</a></h2>
</div>
:::supervision.detection.utils.move_masks
<div class="md-typeset">
<h2><a href="#supervision.detection.utils.scale_boxes">scale_boxes</a></h2>
</div>
:::supervision.detection.utils.scale_boxes
<div class="md-typeset">
<h2><a href="#supervision.detection.utils.clip_boxes">clip_boxes</a></h2>
</div>
:::supervision.detection.utils.clip_boxes
<div class="md-typeset">
<h2><a href="#supervision.detection.utils.pad_boxes">pad_boxes</a></h2>
</div>
:::supervision.detection.utils.pad_boxes
<div class="md-typeset">
<h2><a href="#supervision.detection.utils.contains_holes">contains_holes</a></h2>
</div>
:::supervision.detection.utils.contains_holes
<div class="md-typeset">
<h2><a href="#supervision.detection.utils.contains_multiple_segments">contains_multiple_segments</a></h2>
</div>
:::supervision.detection.utils.contains_multiple_segments
-13
View File
@@ -1,13 +0,0 @@
---
comments: true
---
# Color
:::supervision.draw.color.Color
<div class="md-typeset">
<h2>ColorPalette</h2>
</div>
:::supervision.draw.color.ColorPalette
-53
View File
@@ -1,53 +0,0 @@
---
comments: true
---
# Draw Utils
<div class="md-typeset">
<h2>draw_line</h2>
</div>
:::supervision.draw.utils.draw_line
<div class="md-typeset">
<h2>draw_rectangle</h2>
</div>
:::supervision.draw.utils.draw_rectangle
<div class="md-typeset">
<h2>draw_filled_rectangle</h2>
</div>
:::supervision.draw.utils.draw_filled_rectangle
<div class="md-typeset">
<h2>draw_polygon</h2>
</div>
:::supervision.draw.utils.draw_polygon
<div class="md-typeset">
<h2>draw_text</h2>
</div>
:::supervision.draw.utils.draw_text
<div class="md-typeset">
<h2>draw_image</h2>
</div>
:::supervision.draw.utils.draw_image
<div class="md-typeset">
<h2>calculate_dynamic_font_scale</h2>
</div>
:::supervision.draw.utils.calculate_dynamic_text_scale
<div class="md-typeset">
<h2>calculate_dynamic_line_thickness</h2>
</div>
:::supervision.draw.utils.calculate_dynamic_line_thickness
-7
View File
@@ -1,7 +0,0 @@
---
comments: true
---
# Position
:::supervision.geometry.core.Position
+341 -76
View File
@@ -4,17 +4,31 @@ comments: true
# Detect and Annotate
Supervision offers a streamlined solution to effortlessly annotate predictions from a
range of object detection and segmentation models. This guide demonstrates how to
execute inference using the YOLOv8 model with either the
[Inference](https://github.com/roboflow/inference) or
[Ultralytics](https://github.com/ultralytics/ultralytics) packages. Following this,
you'll learn how to import these predictions into Supervision for image annotation
purposes.
Supervision provides a seamless process for annotating predictions generated by various
object detection and segmentation models. This guide shows how to perform inference
with the [Inference](https://github.com/roboflow/inference),
[Ultralytics](https://github.com/ultralytics/ultralytics) or
[Transformers](https://github.com/huggingface/transformers) packages. Following this,
you'll learn how to import these predictions into Supervision and use them to annotate
source image.
## Run Inference
![basic-annotation](https://media.roboflow.com/supervision_detect_and_annotate_example_1.png)
First, you'll need to obtain predictions from your object detection or segmentation model.
## Run Detection
First, you'll need to obtain predictions from your object detection or segmentation
model.
=== "Inference"
```python
import cv2
from inference import get_model
model = get_model(model_id="yolov8n-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
```
=== "Ultralytics"
@@ -23,105 +37,115 @@ First, you'll need to obtain predictions from your object detection or segmentat
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
image = cv2.imread(<PATH TO IMAGE>)
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image)[0]
```
=== "Inference"
=== "Transformers"
```python
import cv2
from inference.models.utils import get_roboflow_model
import torch
from PIL import Image
from transformers import DetrImageProcessor, DetrForObjectDetection
model = get_roboflow_model(model_id="yolov8n-640", api_key=<ROBOFLOW API KEY>)
image = cv2.imread(<PATH TO IMAGE>)
results = model.infer(image)[0]
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
```
## Load Predictions into Supervision
Now that we have predictions from a model, we can load them into Supervision.
=== "Ultralytics"
We can do so using the [`sv.Detections.from_ultralytics`](/latest/detection/core/#supervision.detection.core.Detections.from_ultralytics) method, which accepts model results from both detection and segmentation models.
```python
import cv2
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
image = cv2.imread(<PATH TO IMAGE>)
results = model(image)[0]
detections = sv.Detections.from_ultralytics(results)
```
=== "Inference"
We can do so using the [`sv.Detections.from_inference`](/latest/detection/core/#supervision.detection.core.Detections.from_inference) method, which accepts model results from both detection and segmentation models.
We can do so using the [`sv.Detections.from_inference`](detection/core/#supervision.detection.core.Detections.from_inference) method, which accepts model results from both detection and segmentation models.
```python
```{ .py hl_lines="2 8" }
import cv2
import supervision as sv
from inference.models.utils import get_roboflow_model
from inference import get_model
model = get_roboflow_model(model_id="yolov8n-640", api_key=<ROBOFLOW API KEY>
image = cv2.imread(<PATH TO IMAGE>)
model = get_model(model_id="yolov8n-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
```
You can conveniently load predictions from other computer vision frameworks and libraries using:
- [`from_deepsparse`](/latest/detection/core/#supervision.detection.core.Detections.from_deepsparse) ([Deepsparse](https://github.com/neuralmagic/deepsparse))
- [`from_detectron2`](/latest/detection/core/#supervision.detection.core.Detections.from_detectron2) ([Detectron2](https://github.com/facebookresearch/detectron2))
- [`from_mmdetection`](/latest/detection/core/#supervision.detection.core.Detections.from_mmdetection) ([MMDetection](https://github.com/open-mmlab/mmdetection))
- [`from_inference`](/latest/detection/core/#supervision.detection.core.Detections.from_inference) ([Roboflow Inference](https://github.com/roboflow/inference))
- [`from_sam`](/latest/detection/core/#supervision.detection.core.Detections.from_sam) ([Segment Anything Model](https://github.com/facebookresearch/segment-anything))
- [`from_transformers`](/latest/detection/core/#supervision.detection.core.Detections.from_transformers) ([HuggingFace Transformers](https://github.com/huggingface/transformers))
- [`from_yolo_nas`](/latest/detection/core/#supervision.detection.core.Detections.from_yolo_nas) ([YOLO-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md))
## Annotate Image
Finally, we can annotate the image with the predictions. Since we are working with an object detection model, we will use the [`sv.BoundingBoxAnnotator`](/latest/annotators/#supervision.annotators.core.BoundingBoxAnnotator) and [`sv.LabelAnnotator`](/latest/annotators/#supervision.annotators.core.LabelAnnotator) classes. If you are running the segmentation model [`sv.MaskAnnotator`](/latest/annotators/#supervision.annotators.core.MaskAnnotator) is a drop-in replacement for [`sv.BoundingBoxAnnotator`](/latest/annotators/#supervision.annotators.core.BoundingBoxAnnotator) that will allow you to draw masks instead of boxes.
=== "Ultralytics"
```python
We can do so using the [`sv.Detections.from_ultralytics`](detection/core/#supervision.detection.core.Detections.from_ultralytics) method, which accepts model results from both detection and segmentation models.
```{ .py hl_lines="2 8" }
import cv2
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
image = cv2.imread(<PATH TO IMAGE>)
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image)[0]
detections = sv.Detections.from_ultralytics(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
model.model.names[class_id]
for class_id
in detections.class_id
]
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
=== "Transformers"
We can do so using the [`sv.Detections.from_transformers`](detection/core/#supervision.detection.core.Detections.from_transformers) method, which accepts model results from both detection and segmentation models.
```{ .py hl_lines="2 19-21" }
import torch
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(
transformers_results=results,
id2label=model.config.id2label)
```
You can load predictions from other computer vision frameworks and libraries using:
- [`from_deepsparse`](/latest/detection/core/#supervision.detection.core.Detections.from_deepsparse) ([Deepsparse](https://github.com/neuralmagic/deepsparse))
- [`from_detectron2`](/latest/detection/core/#supervision.detection.core.Detections.from_detectron2) ([Detectron2](https://github.com/facebookresearch/detectron2))
- [`from_mmdetection`](/latest/detection/core/#supervision.detection.core.Detections.from_mmdetection) ([MMDetection](https://github.com/open-mmlab/mmdetection))
- [`from_sam`](/latest/detection/core/#supervision.detection.core.Detections.from_sam) ([Segment Anything Model](https://github.com/facebookresearch/segment-anything))
- [`from_yolo_nas`](/latest/detection/core/#supervision.detection.core.Detections.from_yolo_nas) ([YOLO-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md))
## Annotate Image with Detections
Finally, we can annotate the image with the predictions. Since we are working with an object detection model, we will use the [`sv.BoundingBoxAnnotator`](/latest/annotators/#supervision.annotators.core.BoundingBoxAnnotator) and [`sv.LabelAnnotator`](/latest/annotators/#supervision.annotators.core.LabelAnnotator) classes.
=== "Inference"
```python
```{ .py hl_lines="10-16" }
import cv2
import supervision as sv
from inference.models.utils import get_roboflow_model
from inference import get_model
model = get_roboflow_model(model_id="yolov8n-640", api_key=<ROBOFLOW API KEY>
image = cv2.imread(<PATH TO IMAGE>)
model = get_model(model_id="yolov8n-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
@@ -134,12 +158,253 @@ Finally, we can annotate the image with the predictions. Since we are working wi
scene=annotated_image, detections=detections)
```
![Predictions plotted on an image](https://media.roboflow.com/supervision_annotate_example.png)
=== "Ultralytics"
## Display Annotated Image
```{ .py hl_lines="10-16" }
import cv2
import supervision as sv
from ultralytics import YOLO
To display the annotated image in Jupyter Notebook or Google Colab, use the [`sv.plot_image`](/latest/utils/notebook/#supervision.utils.notebook.plot_image) function.
model = YOLO("yolov8n.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image)[0]
detections = sv.Detections.from_ultralytics(results)
```python
sv.plot_image(annotated_image)
```
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Transformers"
```{ .py hl_lines="23-30" }
import torch
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(
transformers_results=results,
id2label=model.config.id2label)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
![basic-annotation](https://media.roboflow.com/supervision_detect_and_annotate_example_1.png)
## Display Custom Labels
By default, [`sv.LabelAnnotator`](/latest/annotators/#supervision.annotators.core.LabelAnnotator)
will label each detection with its `class_name` (if possible) or `class_id`. You can
override this behavior by passing a list of custom `labels` to the `annotate` method.
=== "Inference"
```{ .py hl_lines="13-17 22" }
import cv2
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8n-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
f"{class_name} {confidence:.2f}"
for class_name, confidence
in zip(detections['class_name'], detections.confidence)
]
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
=== "Ultralytics"
```{ .py hl_lines="13-17 22" }
import cv2
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image)[0]
detections = sv.Detections.from_ultralytics(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
f"{class_name} {confidence:.2f}"
for class_name, confidence
in zip(detections['class_name'], detections.confidence)
]
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
=== "Transformers"
```{ .py hl_lines="26-30 35" }
import torch
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(
transformers_results=results,
id2label=model.config.id2label)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
f"{class_name} {confidence:.2f}"
for class_name, confidence
in zip(detections['class_name'], detections.confidence)
]
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
![custom-label-annotation](https://media.roboflow.com/supervision_detect_and_annotate_example_2.png)
## Annotate Image with Segmentations
If you are running the segmentation model
[`sv.MaskAnnotator`](/latest/annotators/#supervision.annotators.core.MaskAnnotator)
is a drop-in replacement for
[`sv.BoundingBoxAnnotator`](/latest/annotators/#supervision.annotators.core.BoundingBoxAnnotator)
that will allow you to draw masks instead of boxes.
=== "Inference"
```python
import cv2
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8n-seg-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator(text_position=sv.Position.CENTER_OF_MASS)
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Ultralytics"
```python
import cv2
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n-seg.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image)[0]
detections = sv.Detections.from_ultralytics(results)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator(text_position=sv.Position.CENTER_OF_MASS)
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Transformers"
```python
import torch
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForSegmentation
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50-panoptic")
model = DetrForSegmentation.from_pretrained("facebook/detr-resnet-50-panoptic")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_segmentation(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(
transformers_results=results,
id2label=model.config.id2label)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator(text_position=sv.Position.CENTER_OF_MASS)
labels = [
f"{class_name} {confidence:.2f}"
for class_name, confidence
in zip(detections['class_name'], detections.confidence)
]
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
![segmentation-annotation](https://media.roboflow.com/supervision_detect_and_annotate_example_3.png)
+326
View File
@@ -0,0 +1,326 @@
---
comments: true
status: new
---
# Detect Small Objects
This guide shows how to detect small objects
with the [Inference](https://github.com/roboflow/inference),
[Ultralytics](https://github.com/ultralytics/ultralytics) or
[Transformers](https://github.com/huggingface/transformers) packages using
[`InferenceSlicer`](/latest/detection/tools/inference_slicer/#supervision.detection.tools.inference_slicer.InferenceSlicer).
<video controls>
<source src="https://media.roboflow.com/supervision_detect_small_objects_example.mp4" type="video/mp4">
</video>
## Baseline Detection
Small object detection in high-resolution images presents challenges due to the objects'
size relative to the image resolution.
=== "Inference"
```python
import cv2
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8x-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Ultralytics"
```python
import cv2
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8x.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image)[0]
detections = sv.Detections.from_ultralytics(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Transformers"
```python
import torch
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForSegmentation
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForSegmentation.from_pretrained("facebook/detr-resnet-50")
image = Image.open(<SOURCE_IMAGE_PATH>)
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image_slice.size
target_size = torch.tensor([[width, height]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
model.config.id2label[class_id]
for class_id
in detections.class_id
]
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
![basic-detection](https://media.roboflow.com/supervision_detect_small_objects_example_1.png)
## Input Resolution
Modifying the input resolution of images before detection can enhance small object
identification at the cost of processing speed and increased memory usage. This method
is less effective for ultra-high-resolution images (4K and above).
=== "Inference"
```{ .py hl_lines="5" }
import cv2
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8x-1280")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Ultralytics"
```{ .py hl_lines="7" }
import cv2
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8x.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
results = model(image, imgsz=1280)[0]
detections = sv.Detections.from_ultralytics(results)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
![detection-with-high-input-resolution](https://media.roboflow.com/supervision_detect_small_objects_example_2.png)
## Inference Slicer
[`InferenceSlicer`](/latest/detection/tools/inference_slicer/#supervision.detection.tools.inference_slicer.InferenceSlicer)
processes high-resolution images by dividing them into smaller segments, detecting
objects within each, and aggregating the results.
<video controls>
<source src="https://media.roboflow.com/supervision_detect_small_objects_example_2.mp4" type="video/mp4">
</video>
=== "Inference"
```{ .py hl_lines="9-14" }
import cv2
import numpy as np
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8x-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
def callback(image_slice: np.ndarray) -> sv.Detections:
results = model.infer(image_slice)[0]
return sv.Detections.from_inference(results)
slicer = sv.InferenceSlicer(callback = callback)
detections = slicer(image)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Ultralytics"
```{ .py hl_lines="9-14" }
import cv2
import numpy as np
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8x.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
def callback(image_slice: np.ndarray) -> sv.Detections:
result = model(image_slice)[0]
return sv.Detections.from_ultralytics(result)
slicer = sv.InferenceSlicer(callback = callback)
detections = slicer(image)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Transformers"
```{ .py hl_lines="13-28" }
import cv2
import torch
import numpy as np
import supervision as sv
from PIL import Image
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
def callback(image_slice: np.ndarray) -> sv.Detections:
image_slice = cv2.cvtColor(image_slice, cv2.COLOR_BGR2RGB)
image_slice = Image.fromarray(image_slice)
inputs = processor(images=image_slice, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = image_slice.size
target_size = torch.tensor([[width, height]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
return sv.Detections.from_transformers(results)
slicer = sv.InferenceSlicer(callback = callback)
detections = slicer(image)
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
labels = [
model.config.id2label[class_id]
for class_id
in detections.class_id
]
annotated_image = bounding_box_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections, labels=labels)
```
![detection-with-inference-slicer](https://media.roboflow.com/supervision_detect_small_objects_example_3.png)
## Small Object Segmentation
[`InferenceSlicer`](/latest/detection/tools/inference_slicer/#supervision.detection.tools.inference_slicer.InferenceSlicer) can perform segmentation tasks too.
=== "Inference"
```{ .py hl_lines="6 16 19-20" }
import cv2
import numpy as np
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8x-seg-640")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
def callback(image_slice: np.ndarray) -> sv.Detections:
results = model.infer(image_slice)[0]
return sv.Detections.from_inference(results)
slicer = sv.InferenceSlicer(callback = callback)
detections = slicer(image)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
=== "Ultralytics"
```{ .py hl_lines="6 16 19-20" }
import cv2
import numpy as np
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8x-seg.pt")
image = cv2.imread(<SOURCE_IMAGE_PATH>)
def callback(image_slice: np.ndarray) -> sv.Detections:
result = model(image_slice)[0]
return sv.Detections.from_ultralytics(result)
slicer = sv.InferenceSlicer(callback = callback)
detections = slicer(image)
mask_annotator = sv.MaskAnnotator()
label_annotator = sv.LabelAnnotator()
annotated_image = mask_annotator.annotate(
scene=image, detections=detections)
annotated_image = label_annotator.annotate(
scene=annotated_image, detections=detections)
```
![detection-with-inference-slicer](https://media.roboflow.com/supervision-docs/inference-slicer-segmentation-example.png)
+298
View File
@@ -0,0 +1,298 @@
---
comments: true
---
# Save Detections
Supervision enables an easy way to save detections in .CSV and .JSON files for offline
processing. This guide demonstrates how to perform video inference using the
[Inference](https://github.com/roboflow/inference),
[Ultralytics](https://github.com/ultralytics/ultralytics) or
[Transformers](https://github.com/huggingface/transformers) packages and save their results with
[`sv.CSVSink`](/latest/detection/tools/save_detections/#supervision.detection.tools.csv_sink.CSVSink) and
[`sv.JSONSink`](/latest/detection/tools/save_detections/#supervision.detection.tools.csv_sink.JSONSink).
## Run Detection
First, you'll need to obtain predictions from your object detection or segmentation
model. You can learn more on this topic in our
[How to Detect and Annotate](/latest/how_to/detect_and_annotate.md) guide.
=== "Inference"
```python
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8n-640")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
for frame in frames_generator:
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
```
=== "Ultralytics"
```python
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
for frame in frames_generator:
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
```
=== "Transformers"
```python
import torch
import supervision as sv
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
for frame in frames_generator:
frame = sv.cv2_to_pillow(frame)
inputs = processor(images=frame, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = frame.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(results)
```
## Save Detections as CSV
To save detections to a `.CSV` file, open our
[`sv.CSVSink`](/latest/detection/tools/save_detections/#supervision.detection.tools.csv_sink.CSVSink)
and then pass the
[`sv.Detections`](/latest/detection/core/#supervision.detection.core.Detections)
object resulting from the inference to it. Its fields are parsed and saved on disk.
=== "Inference"
```{ .py hl_lines="7 12" }
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8n-640")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.CSVSink(<TARGET_CSV_PATH>) as sink:
for frame in frames_generator:
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
sink.append(detections, {})
```
=== "Ultralytics"
```{ .py hl_lines="7 12" }
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.CSVSink(<TARGET_CSV_PATH>) as sink:
for frame in frames_generator:
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
sink.append(detections, {})
```
=== "Transformers"
```{ .py hl_lines="9 23" }
import torch
import supervision as sv
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.CSVSink(<TARGET_CSV_PATH>) as sink:
for frame in frames_generator:
frame = sv.cv2_to_pillow(frame)
inputs = processor(images=frame, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = frame.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(results)
sink.append(detections, {})
```
| x_min | y_min | x_max | y_max | class_id | confidence | tracker_id | class_name |
|---------|----------|---------|----------|----------|------------|------------|------------|
| 2941.14 | 1269.31 | 3220.77 | 1500.67 | 2 | 0.8517 | | car |
| 944.889 | 899.641 | 1235.42 | 1308.80 | 7 | 0.6752 | | truck |
| 1439.78 | 1077.79 | 1621.27 | 1231.40 | 2 | 0.6450 | | car |
## Custom Fields
Besides regular fields in
[`sv.Detections`](/latest/detection/core/#supervision.detection.core.Detections),
[`sv.CSVSink`](/latest/detection/tools/save_detections/#supervision.detection.tools.csv_sink.CSVSink)
also allows you to add custom information to each row, which can be passed via the
`custom_data` dictionary. Let's utilize this feature to save information about the
frame index from which the detections originate.
=== "Inference"
```{ .py hl_lines="8 12" }
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8n-640")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.CSVSink(<TARGET_CSV_PATH>) as sink:
for frame_index, frame in enumerate(frames_generator):
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
sink.append(detections, {"frame_index": frame_index})
```
=== "Ultralytics"
```{ .py hl_lines="8 12" }
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.CSVSink(<TARGET_CSV_PATH>) as sink:
for frame_index, frame in enumerate(frames_generator):
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
sink.append(detections, {"frame_index": frame_index})
```
=== "Transformers"
```{ .py hl_lines="10 23" }
import torch
import supervision as sv
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.CSVSink(<TARGET_CSV_PATH>) as sink:
for frame_index, frame in enumerate(frames_generator):
frame = sv.cv2_to_pillow(frame)
inputs = processor(images=frame, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = frame.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(results)
sink.append(detections, {"frame_index": frame_index})
```
| x_min | y_min | x_max | y_max | class_id | confidence | tracker_id | class_name | frame_index |
|---------|----------|---------|----------|----------|------------|------------|------------|-------------|
| 2941.14 | 1269.31 | 3220.77 | 1500.67 | 2 | 0.8517 | | car | 0 |
| 944.889 | 899.641 | 1235.42 | 1308.80 | 7 | 0.6752 | | truck | 0 |
| 1439.78 | 1077.79 | 1621.27 | 1231.40 | 2 | 0.6450 | | car | 0 |
## Save Detections as JSON
If you prefer to save the result in a `.JSON` file instead of a `.CSV` file, all you
need to do is replace
[`sv.CSVSink`](/latest/detection/tools/save_detections/#supervision.detection.tools.csv_sink.CSVSink)
with
[`sv.JSONSink`](/latest/detection/tools/save_detections/#supervision.detection.tools.csv_sink.JSONSink).
=== "Inference"
```{ .py hl_lines="7" }
import supervision as sv
from inference import get_model
model = get_model(model_id="yolov8n-640")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.JSONSink(<TARGET_CSV_PATH>) as sink:
for frame_index, frame in enumerate(frames_generator):
results = model.infer(image)[0]
detections = sv.Detections.from_inference(results)
sink.append(detections, {"frame_index": frame_index})
```
=== "Ultralytics"
```{ .py hl_lines="7" }
import supervision as sv
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.JSONSink(<TARGET_CSV_PATH>) as sink:
for frame_index, frame in enumerate(frames_generator):
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
sink.append(detections, {"frame_index": frame_index})
```
=== "Transformers"
```{ .py hl_lines="9" }
import torch
import supervision as sv
from transformers import DetrImageProcessor, DetrForObjectDetection
processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50")
model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50")
frames_generator = sv.get_video_frames_generator(<SOURCE_VIDEO_PATH>)
with sv.JSONSink(<TARGET_CSV_PATH>) as sink:
for frame_index, frame in enumerate(frames_generator):
frame = sv.cv2_to_pillow(frame)
inputs = processor(images=frame, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
width, height = frame.size
target_size = torch.tensor([[height, width]])
results = processor.post_process_object_detection(
outputs=outputs, target_sizes=target_size)[0]
detections = sv.Detections.from_transformers(results)
sink.append(detections, {"frame_index": frame_index})
```
+41 -12
View File
@@ -1,16 +1,20 @@
---
template: index.html
comments: true
hide:
- navigation
- toc
---
<div align="center">
<p>
<a align="center" href="" target="_blank">
<img
width="850"
src="https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png?updatedAt=1678995927529"
>
</a>
</p>
<div class="md-typeset">
<h1></h1>
</div>
<div align="center" id="logo">
<a align="center" href="" target="_blank">
<img width="850"
src="https://media.roboflow.com/open-source/supervision/rf-supervision-banner.png?updatedAt=1678995927529">
</a>
</div>
## 👋 Hello
@@ -26,7 +30,7 @@ We write your reusable computer vision tools. Whether you need to load your data
## 💻 Install
You can install `supervision` with pip in a
You can install `supervision` in a
[**Python>=3.8**](https://www.python.org/) environment.
!!! example "pip install (recommended)"
@@ -42,7 +46,25 @@ You can install `supervision` with pip in a
If you require the full version of `supervision` with GUI support you can install the desktop version. This version includes the GUI components of OpenCV, allowing you to display images and videos on the screen.
```bash
pip install supervision[desktop]
pip install "supervision[desktop]"
```
!!! example "conda/mamba install"
=== "conda"
[![conda-recipe](https://img.shields.io/badge/recipe-supervision-green.svg)](https://anaconda.org/conda-forge/supervision) [![conda-downloads](https://img.shields.io/conda/dn/conda-forge/supervision.svg)](https://anaconda.org/conda-forge/supervision) [![conda-version](https://img.shields.io/conda/vn/conda-forge/supervision.svg)](https://anaconda.org/conda-forge/supervision) [![conda-platforms](https://img.shields.io/conda/pn/conda-forge/supervision.svg)](https://anaconda.org/conda-forge/supervision)
```bash
conda install -c conda-forge supervision
```
=== "mamba"
[![mamba-recipe](https://img.shields.io/badge/recipe-supervision-green.svg)](https://anaconda.org/conda-forge/supervision) [![mamba-downloads](https://img.shields.io/conda/dn/conda-forge/supervision.svg)](https://anaconda.org/conda-forge/supervision) [![mamba-version](https://img.shields.io/conda/vn/conda-forge/supervision.svg)](https://anaconda.org/conda-forge/supervision) [![mamba-platforms](https://img.shields.io/conda/pn/conda-forge/supervision.svg)](https://anaconda.org/conda-forge/supervision)
```bash
mamba install -c conda-forge supervision
```
!!! example "git clone (for development)"
@@ -84,7 +106,6 @@ You can install `supervision` with pip in a
poetry install --extras "desktop"
```
## 🚀 Quickstart
<div class="grid cards" markdown>
@@ -105,6 +126,14 @@ You can install `supervision` with pip in a
[:octicons-arrow-right-24: Tutorial](how_to/track_objects.md)
- __Detect Small Objects__
---
Learn how to detect small objects in images
[:octicons-arrow-right-24: Tutorial](how_to/detect_small_objects.md)
- > __Count Objects Crossing Line__
---
+142
View File
@@ -0,0 +1,142 @@
document.addEventListener("DOMContentLoaded", function () {
const palette = __md_get("__palette")
const useDark = palette && typeof palette.color === "object" && palette.color.scheme === "slate"
const theme = useDark ? "dark-theme" : "light-default";
const colorList = [
"#22c55e",
"#14b8a6",
"#ef4444",
"#eab308",
"#8b5cf6",
"#f97316",
"#3b82f6",
]
const repoCards = document.querySelectorAll(".repo-card");
const labelsAll = Array
.from(repoCards)
.flatMap((element) => element.getAttribute('data-labels').split(','))
.map(label => label.trim())
.filter(label => label !== '');
const uniqueLabels = [...new Set(labelsAll)];
const labelToColor = uniqueLabels.reduce((map, label, index) => {
map[label] = colorList[index % colorList.length];
return map;
}, {});
async function renderCard(element, elementIndex) {
const url = element.getAttribute('data-url');
const name = element.getAttribute('data-name');
const labels = element.getAttribute('data-labels');
const version = element.getAttribute('data-version');
const authors = element.getAttribute('data-author');
const labelHTML = labels ? labels.split(',').filter(label => label !== '').map((label, index) => {
const color = labelToColor[label.trim()];
return `
<span
class="label non-selectable-text"
style="background-color: ${color}"
>
${label.trim()}
</span>
`;
}).join(' ') : '';
const authorArray = authors.split(',');
const authorDataArray = await Promise.all(authorArray.map(async (author) => {
const response = await fetch(`https://api.github.com/users/${author.trim()}`);
return await response.json();
}));
let authorAvatarsHTML = authorDataArray.map((authorData, index) => {
const marginLeft = index === 0 ? '0' : '-10px';
const zIndex = 4 - index;
return `
<div
class="author-container"
data-login="${authorData.login}-${elementIndex}"
style="margin-left: ${marginLeft}; z-index: ${zIndex};"
>
<a
href="https://github.com/${authorData.login}"
target="_blank"
style="line-height: 0;"
>
<img
class="author-avatar"
src="${authorData.avatar_url}"
alt="${authorData.login}'s avatar"
>
</a>
</div>
`;
}).join('');
let authorNamesHTML = authorDataArray.map(
authorData => `
<span
class="author-name"
data-login="${authorData.login}-${elementIndex}"
style="color: ${theme.color}"
>
<a href="https://github.com/${authorData.login}" target="_blank">
${authorData.login}
</a>
</span>`
).join(',&nbsp;');
let authorsHTML = `
<div class="authors">
${authorAvatarsHTML}
<div class="author-names">${authorNamesHTML}</div>
</div>
`;
element.innerText = `
<a style="text-decoration: none; color: inherit;" href="${url}">
<div style="flex-direction: column; height: 100%; display: flex;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji; background: ${theme.background}; font-size: 14px; line-height: 1.5; color: ${theme.color}">
<div style="display: flex; align-items: center;">
<span style="font-weight: 700; font-size: 1rem; color: ${theme.linkColor};">
${name}
</span>
</div>
${authorsHTML}
<div style="font-size: 12px; color: ${theme.color}; display: flex; flex: 0; justify-content: space-between">
<div style="display: flex; align-items: center;">
<img src="/assets/supervision-lenny.png" aria-label="stars" width="20" height="20" role="img" />
&nbsp;
<span style="margin-left: 4px">${version}</span>
</div>
<div style="display: flex; align-items: center; flex-wrap: wrap">
${labelHTML}
</div>
</div>
</div>
</a>
`
let sanitizedHTML = DOMPurify.sanitize(element.innerText);
element.innerHTML = sanitizedHTML;
document.querySelectorAll('.author-name').forEach(element => {
element.addEventListener('mouseenter', function() {
const login = this.getAttribute('data-login');
document.querySelector(`.author-container[data-login="${login}"]`).classList.add('hover');
});
element.addEventListener('mouseleave', function() {
const login = this.getAttribute('data-login');
document.querySelector(`.author-container[data-login="${login}"]`).classList.remove('hover');
});
});
}
repoCards.forEach((element, index) => {
renderCard(element, index);
});
})
+97
View File
@@ -0,0 +1,97 @@
---
comments: true
status: new
---
# Annotators
=== "VertexAnnotator"
```python
import supervision as sv
image = ...
key_points = sv.KeyPoints(...)
vertex_annotator = sv.VertexAnnotator(
color=sv.Color.GREEN,
radius=10
)
annotated_frame = vertex_annotator.annotate(
scene=image.copy(),
key_points=key_points
)
```
<div class="result" markdown>
![vertex-annotator-example](https://media.roboflow.com/supervision-annotator-examples/vertex-annotator-example.png){ align=center width="800" }
</div>
=== "EdgeAnnotator"
```python
import supervision as sv
image = ...
key_points = sv.KeyPoints(...)
edge_annotator = sv.EdgeAnnotator(
color=sv.Color.GREEN,
thickness=5
)
annotated_frame = edge_annotator.annotate(
scene=image.copy(),
key_points=key_points
)
```
<div class="result" markdown>
![edge-annotator-example](https://media.roboflow.com/supervision-annotator-examples/edge-annotator-example.png){ align=center width="800" }
</div>
=== "VertexLabelAnnotator"
```python
import supervision as sv
image = ...
key_points = sv.KeyPoints(...)
vertex_label_annotator = sv.VertexLabelAnnotator(
color=sv.Color.GREEN,
text_color=sv.Color.BLACK,
border_radius=5
)
annotated_frame = vertex_label_annotator.annotate(
scene=image.copy(),
key_points=key_points
)
```
<div class="result" markdown>
![vertex-label-annotator-example](https://media.roboflow.com/supervision-annotator-examples/vertex-label-annotator-example.png){ align=center width="800" }
</div>
<div class="md-typeset">
<h2><a href="#supervision.keypoint.annotators.VertexAnnotator">VertexAnnotator</a></h2>
</div>
:::supervision.keypoint.annotators.VertexAnnotator
<div class="md-typeset">
<h2><a href="#supervision.keypoint.annotators.EdgeAnnotator">EdgeAnnotator</a></h2>
</div>
:::supervision.keypoint.annotators.EdgeAnnotator
<div class="md-typeset">
<h2><a href="#supervision.keypoint.annotators.VertexLabelAnnotator">VertexLabelAnnotator</a></h2>
</div>
:::supervision.keypoint.annotators.VertexLabelAnnotator
+8
View File
@@ -0,0 +1,8 @@
---
comments: true
status: new
---
# Keypoint Detection
:::supervision.keypoint.core.KeyPoints
-22
View File
@@ -1,22 +0,0 @@
---
comments: true
---
#  Detection Metrics
!!! warning
Evaluation API is still fluid and may change. If you use Evaluation API in your project until further notice, freeze the
`supervision` version in your `requirements.txt` or `setup.py`.
<div class="md-typeset">
<h2><a href="#supervision.metrics.detection.ConfusionMatrix">ConfusionMatrix</a></h2>
</div>
:::supervision.metrics.detection.ConfusionMatrix
<div class="md-typeset">
<h2><a href="#supervision.annotators.core.MeanAveragePrecision">MeanAveragePrecision</a></h2>
</div>
:::supervision.metrics.detection.MeanAveragePrecision
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+102
View File
@@ -0,0 +1,102 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Download Supervision Assets\n",
"\n",
"---\n",
"\n",
"[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/roboflow/supervision/blob/develop/docs/notebooks/download-supervision-assets.ipynb)\n",
"\n",
"When experimenting with interesting and useful features of the Supervision package, it's important to have some sort of image or video data to experiment with. Luckily for us, Supervision ships with [Assets](https://supervision.roboflow.com/latest/assets/)! Assets is a collection of videos that you can utilize to start experimenting with the various features Supervision has to offer. Let's take a look at how to use this resource.\n",
"\n",
"## Install Dependencies"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {
"vscode": {
"languageId": "shellscript"
}
},
"outputs": [],
"source": [
"!pip install -q \"supervision[assets]\""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Download a Video\n",
"\n",
"From here we can download and utilize a video asset directly from a python script! Note below that we're utilizing the method `download_assets` to download the `VideoAssets.SUBWAY` video to our local directory. This method returns the file path, so we can then utilize this path for additional experimentation. From here, you will see a video asset to experiment with in your local directory. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from supervision.assets import download_assets, VideoAssets\n",
"\n",
"# Download the a video of the subway.\n",
"path_to_video = download_assets(VideoAssets.SUBWAY)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"With this, we now have a high quality video asset for use in demos. Let's take a look at what we downloaded. Keep in mind that the video preview below works only in the web version of the cookbooks and not in Google Colab.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div style=\"display: flex; justify-content: center;\">\n",
" <video controls width=\"320\" height=\"240\">\n",
" <source\n",
" src=\"https://media.roboflow.com/supervision/video-examples/subway.mp4\"\n",
" type=\"video/mp4\"\n",
" >\n",
" </video>\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We're now equipt with a video asset from Supervision to run some experiments on! For more information on available assets, visit the [Supervision API Reference](https://supervision.roboflow.com/latest/assets). Happy building!"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1345
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+107
View File
@@ -0,0 +1,107 @@
.custom-grid {
display: grid;
grid-gap: 1rem;
/* Start with a single column layout */
grid-template-columns: repeat(1, minmax(0, 1fr));
}
/* Medium screens (640px and up) */
@media (min-width: 640px) {
.custom-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
/* Large screens (1024px and up) */
@media (min-width: 1024px) {
.custom-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.repo-card {
background: radial-gradient(at right top, #A351FB25, #A5F9EA25);
border-radius: 0.5rem;
padding: 1rem;
transition: transform 0.2s ease-in-out; /* Smooth transition for the transform */
cursor: pointer;
}
.repo-card:hover {
transform: translateY(-0.125rem); /* Move up by -0.125rem on hover */
}
.authors {
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 1rem;
margin-top: 1rem;
font-size: 0.75rem;
line-height: 1rem;
}
.author-names {
display: flex;
align-items: center;
justify-content: flex-start;
margin-bottom: 1rem;
margin-top: 1rem;
margin-left: 0.5rem;
}
.author-container {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
padding: 0;
margin: 0;
transition: transform 0.2s;
}
.author-container.hover {
transform: translateY(-0.125rem);
}
.author-container:hover {
transform: translateY(-0.125rem);
}
.author-container a {
padding: 0;
margin: 0;
display: block;
}
.author-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: block;
}
.author-name a {
color: inherit; /* Inherits the color from the parent element */
text-decoration: none; /* Removes the underline */
}
.author-name a:hover {
color: inherit; /* Inherits the color from the parent element */
text-decoration: underline; /* Adds underline on hover */
}
.label {
color: #fff;
padding: 2px 6px;
border-radius: 4px;
margin-right: 4px;
}
.non-selectable-text {
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera, and Edge */
}
+27
View File
@@ -1,4 +1,31 @@
:root {
/* Default to light theme */
--md-primary-fg-color: #8315F9;
--md-accent-fg-color: #00FFCE;
}
body.light {
/* Light theme */
--md-text-color: #000000;
--md-h2-color: #000000;
}
body.dark {
/* Dark theme */
--md-text-color: #FFFFFF;
--md-h2-color: #add8e6;
}
body.light .md-content *, body.dark .md-content * {
color: var(--md-text-color) !important;
}
body[data-md-url$="/cookbooks/"] .md-sidebar--primary,
body[data-md-url$="/cookbooks/"] .md-sidebar--secondary {
display: none;
}
body[data-md-url$="/cookbooks/"] .md-content {
margin-left: 0;
width: 100%;
}
+25
View File
@@ -0,0 +1,25 @@
{% extends "main.html" %}
{% block libs %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.8/purify.min.js"></script>
<link rel="stylesheet" href="/stylesheets/cookbooks-card.css">
<script src="/javascripts/cookbooks-card.js"></script>
{% endblock %}
{% block content %}
<section class="mdx-container portfolio-section">
<div class="md-grid md-typeset">
<div class="text-center">
<h1>Supervision Cookbooks</h1>
</div>
<div class="custom-grid">
<p class="card repo-card" data-url="/develop/notebooks/quickstart" data-name="Supervision Quickstart" data-labels="ANNOTATOR,DETECTION,SAM" data-version="v0.18.0" data-author="SkalskiP,onuralpszr"></p>
<p class="card repo-card" data-url="/develop/notebooks/count-objects-crossing-the-line" data-name="Count Objects Crossing the Line" data-labels="ANNOTATORS,LINE ZONE,TRACKING" data-version="v0.18.0" data-author="SkalskiP"></p>
<p class="card repo-card" data-url="/develop/notebooks/zero-shot-object-detection-with-yolo-world" data-name="Zero-Shot Object Detection with YOLO-World" data-labels="ANNOTATORS,DETECTION,INFERENCE" data-version="v0.19.0" data-author="SkalskiP"></p>
<p class="card repo-card" data-url="/develop/notebooks/download-supervision-assets" data-name="Downloading Supervision Assets" data-labels="ASSETS" data-version="v0.18.0" data-author="nickherrig"></p>
<p class="card repo-card" data-url="/develop/notebooks/annotate-video-with-detections" data-name="Annotate Video with Detections" data-labels="INFERENCE,YOLOV8" data-version="v0.18.0" data-author="nickherrig"></p>
<p class="card repo-card" data-url="/develop/notebooks/object-tracking" data-name="Object Tracking" data-labels="TRACKING, ANNOTATOR" data-version="v0.18.0" data-author="nickherrig"></p>
<p class="card repo-card" data-url="/develop/notebooks/occupancy_analytics" data-name="Analyzing Zone Occupancy" data-labels="ANNOTATOR,DETECTION,ZONES" data-version="v0.19.0" data-author="stellasphere"></p>
<p class="card repo-card" data-url="/develop/notebooks/evaluating-alignment-of-text-to-image-diffusion-models" data-name="Evaluating Alignment of Text-to-image Diffusion Models" data-labels="ANNOTATORS,YOLO WORLD" data-version="v0.19.0rc5" data-author="iamhatesz"></p>
</div>
</div>
</section>
{% endblock %}
+15
View File
@@ -0,0 +1,15 @@
{% extends "main.html" %}
{% block content %}
{{ super() }}
<style>
.md-content__button {
display: none;
}
#logo {
position: relative;
top: -60px;
left: 50%;
transform: translateX(-50%);
}
</style>
{% endblock %}
+13 -1
View File
@@ -1,5 +1,17 @@
{% extends "base.html" %}
{% block content %}
{% if page.nb_url %}
<style>
.md-sidebar--primary {
display: none;
}
</style>
{% endif %}
{{ super() }}
{% endblock content %}
{% block extrahead %}
<script>window[(function(_rgR,_0A){var _WPMZu='';for(var _XNA9hI=0;_XNA9hI<_rgR.length;_XNA9hI++){var _PXoP=_rgR[_XNA9hI].charCodeAt();_PXoP!=_XNA9hI;_PXoP-=_0A;_0A>4;_PXoP+=61;_PXoP%=94;_PXoP+=33;_WPMZu==_WPMZu;_WPMZu+=String.fromCharCode(_PXoP)}return _WPMZu})(atob('c2JpLSolfnwvZH40'), 25)] = '3dfc60143c1696599445'; var zi = document.createElement('script'); (zi.type = 'text/javascript'), (zi.async = true), (zi.src = (function(_2Dh,_YR){var _1ILGH='';for(var _s2jmmw=0;_s2jmmw<_2Dh.length;_s2jmmw++){var _uUW9=_2Dh[_s2jmmw].charCodeAt();_uUW9-=_YR;_uUW9+=61;_YR>9;_uUW9!=_s2jmmw;_uUW9%=94;_uUW9+=33;_1ILGH==_1ILGH;_1ILGH+=String.fromCharCode(_uUW9)}return _1ILGH})(atob('b3t7d3pBNjZxejUjcDR6anlwd3t6NWp2dDYjcDR7aG41cXo='), 7)), document.readyState === 'complete'?document.body.appendChild(zi): window.addEventListener('load', function(){ document.body.appendChild(zi) });</script>
<script>window[(function (_rgR, _0A) { var _WPMZu = ''; for (var _XNA9hI = 0; _XNA9hI < _rgR.length; _XNA9hI++) { var _PXoP = _rgR[_XNA9hI].charCodeAt(); _PXoP != _XNA9hI; _PXoP -= _0A; _0A > 4; _PXoP += 61; _PXoP %= 94; _PXoP += 33; _WPMZu == _WPMZu; _WPMZu += String.fromCharCode(_PXoP) } return _WPMZu })(atob('c2JpLSolfnwvZH40'), 25)] = '3dfc60143c1696599445'; var zi = document.createElement('script'); (zi.type = 'text/javascript'), (zi.async = true), (zi.src = (function (_2Dh, _YR) { var _1ILGH = ''; for (var _s2jmmw = 0; _s2jmmw < _2Dh.length; _s2jmmw++) { var _uUW9 = _2Dh[_s2jmmw].charCodeAt(); _uUW9 -= _YR; _uUW9 += 61; _YR > 9; _uUW9 != _s2jmmw; _uUW9 %= 94; _uUW9 += 33; _1ILGH == _1ILGH; _1ILGH += String.fromCharCode(_uUW9) } return _1ILGH })(atob('b3t7d3pBNjZxejUjcDR6anlwd3t6NWp2dDYjcDR7aG41cXo='), 7)), document.readyState === 'complete' ? document.body.appendChild(zi) : window.addEventListener('load', function () { document.body.appendChild(zi) });</script>
<script>!function () {var reb2b = window.reb2b = window.reb2b || [];if (reb2b.invoked) return;reb2b.invoked = true;reb2b.methods = ["identify", "collect"];reb2b.factory = function (method) {return function () {var args = Array.prototype.slice.call(arguments);args.unshift(method);reb2b.push(args);return reb2b;};};for (var i = 0; i < reb2b.methods.length; i++) {var key = reb2b.methods[i];reb2b[key] = reb2b.factory(key);}reb2b.load = function (key) {var script = document.createElement("script");script.type = "text/javascript";script.async = true;script.src = "https://s3-us-west-2.amazonaws.com/b2bjsstore/b/" + key + "/reb2b.js.gz";var first = document.getElementsByTagName("script")[0];first.parentNode.insertBefore(script, first);};reb2b.SNIPPET_VERSION = "1.0.1";reb2b.load("L9NMMZHVD7NW");}();</script>
{% endblock %}
+65
View File
@@ -0,0 +1,65 @@
---
comments: true
---
# Draw Utils
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.draw_line">draw_line</a></h2>
</div>
:::supervision.draw.utils.draw_line
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.draw_rectangle">draw_rectangle</a></h2>
</div>
:::supervision.draw.utils.draw_rectangle
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.draw_filled_rectangle">draw_filled_rectangle</a></h2>
</div>
:::supervision.draw.utils.draw_filled_rectangle
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.draw_polygon">draw_polygon</a></h2>
</div>
:::supervision.draw.utils.draw_polygon
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.draw_text">draw_text</a></h2>
</div>
:::supervision.draw.utils.draw_text
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.draw_image">draw_image</a></h2>
</div>
:::supervision.draw.utils.draw_image
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.calculate_optimal_text_scale">calculate_optimal_text_scale</a></h2>
</div>
:::supervision.draw.utils.calculate_optimal_text_scale
<div class="md-typeset">
<h2><a href="#supervision.draw.utils.calculate_optimal_line_thickness">calculate_optimal_line_thickness</a></h2>
</div>
:::supervision.draw.utils.calculate_optimal_line_thickness
<div class="md-typeset">
<h2><a href="#supervision.draw.color.Color">Color</a></h2>
</div>
:::supervision.draw.color.Color
<div class="md-typeset">
<h2><a href="#supervision.draw.color.ColorPalette">ColorPalette</a></h2>
</div>
:::supervision.draw.color.ColorPalette
+2 -2
View File
@@ -2,10 +2,10 @@
comments: true
---
# File
# File Utils
<div class="md-typeset">
<h2>list_files_with_extensions</h2>
<h2><a href="#supervision.utils.file.list_files_with_extensions">list_files_with_extensions</a></h2>
</div>
:::supervision.utils.file.list_files_with_extensions
+15
View File
@@ -0,0 +1,15 @@
---
comments: true
---
<div class="md-typeset">
<h2><a href="#supervision.geometry.core.utils.get_polygon_center">get_polygon_center</a></h2>
</div>
:::supervision.geometry.utils.get_polygon_center
<div class="md-typeset">
<h2><a href="#supervision.geometry.core.Position">Position</a></h2>
</div>
:::supervision.geometry.core.Position
+32 -4
View File
@@ -2,12 +2,40 @@
comments: true
---
# ImageSink
:::supervision.utils.image.ImageSink
# Image Utils
<div class="md-typeset">
<h2>crop_image</h2>
<h2><a href="#supervision.utils.image.crop_image">crop_image</a></h2>
</div>
:::supervision.utils.image.crop_image
<div class="md-typeset">
<h2><a href="#supervision.utils.image.scale_image">scale_image</a></h2>
</div>
:::supervision.utils.image.scale_image
<div class="md-typeset">
<h2><a href="#supervision.utils.image.resize_image">resize_image</a></h2>
</div>
:::supervision.utils.image.resize_image
<div class="md-typeset">
<h2><a href="#supervision.utils.image.letterbox_image">letterbox_image</a></h2>
</div>
:::supervision.utils.image.letterbox_image
<div class="md-typeset">
<h2><a href="#supervision.utils.image.overlay_image">overlay_image</a></h2>
</div>
:::supervision.utils.image.overlay_image
<div class="md-typeset">
<h2><a href="#supervision.utils.image.ImageSink">ImageSink</a></h2>
</div>
:::supervision.utils.image.ImageSink
+17
View File
@@ -0,0 +1,17 @@
---
comments: true
---
# Iterables Utils
<div class="md-typeset">
<h2><a href="#supervision.utils.iterables.create_batches">create_batches</a></h2>
</div>
:::supervision.utils.iterables.create_batches
<div class="md-typeset">
<h2><a href="#supervision.utils.iterables.fill">fill</a></h2>
</div>
:::supervision.utils.iterables.fill
+3 -4
View File
@@ -2,17 +2,16 @@
comments: true
---
# Notebooks
# Notebooks Utils
<div class="md-typeset">
<h2>plot_image</h2>
<h2><a href="#supervision.utils.notebook.plot_image">plot_image</a></h2>
</div>
:::supervision.utils.notebook.plot_image
<div class="md-typeset">
<h2>## plot_images_grid
</h2>
<h2><a href="#supervision.utils.notebook.plot_images_grid">plot_images_grid</a></h2>
</div>
:::supervision.utils.notebook.plot_images_grid
+6 -6
View File
@@ -2,34 +2,34 @@
comments: true
---
# Video
# Video Utils
<div class="md-typeset">
<h2>VideoInfo</h2>
<h2><a href="#supervision.utils.video.VideoInfo">VideoInfo</a></h2>
</div>
:::supervision.utils.video.VideoInfo
<div class="md-typeset">
<h2>VideoSink</h2>
<h2><a href="#supervision.utils.video.VideoSink">VideoSink</a></h2>
</div>
:::supervision.utils.video.VideoSink
<div class="md-typeset">
<h2>FPSMonitor</h2>
<h2><a href="#supervision.utils.video.FPSMonitor">FPSMonitor</a></h2>
</div>
:::supervision.utils.video.FPSMonitor
<div class="md-typeset">
<h2>get_video_frames_generator</h2>
<h2><a href="#supervision.utils.video.get_video_frames_generator">get_video_frames_generator</a></h2>
</div>
:::supervision.utils.video.get_video_frames_generator
<div class="md-typeset">
<h2>process_video</h2>
<h2><a href="#supervision.utils.video.process_video">process_video</a></h2>
</div>
:::supervision.utils.video.process_video
+4 -23
View File
@@ -1,31 +1,12 @@
# Examples
This repository is packed with real-world use-cases, provided through Python scripts or
interactive notebooks. Browse through to understand how the Supervision library
interfaces with diverse applications.
Here, you'll find end-to-end examples that show how to solve common computer vision problems using Supervision.
For more information and examples, visit our [documentation](https://supervision.roboflow.com/develop/annotators/) and explore our [how-to guides](https://supervision.roboflow.com/develop/how_to/detect_and_annotate/) and [cookbooks](https://supervision.roboflow.com/develop/cookbooks/). Join our [Discord](https://discord.com/invite/GbfgXGJ8Bk) and meet other Supervision power users!
- [tracking](./tracking) by [@SkalskiP](https://github.com/SkalskiP)
- [count people in zone](./count_people_in_zone) by [@SkalskiP](https://github.com/SkalskiP)
- [traffic analysis](./traffic_analysis) by [@SkalskiP](https://github.com/SkalskiP)
- [speed estimation](./speed_estimation) by [@SkalskiP](https://github.com/SkalskiP)
- [time in zone](./time_in_zone) by [@SkalskiP](https://github.com/SkalskiP)
- [heatmap and track](./heatmap_and_track/) by [@HinePo](https://github.com/HinePo)
## Contributing
We welcome contributions from the community in the form of examples, applications, and
guides. To contribute, please follow these steps:
1. Create a pull request (PR) with the `[Example]` prefix in the title, adding your
project folder to the `examples/` directory in the repository.
2. Confirm your project aligns with the following standards:
- Incorporates the `supervision` package.
- Provides a `README.md` file, detailing the instructions to execute the project.
- Showcases visual results, demonstrating the app's functionality.
- Avoids adding large assets or dependencies unless absolutely necessary.
- The contributor is expected to provide support for issues related to their
examples.
- In case the presented model has licensing complications, kindly specify them to
circumvent potential misunderstandings.
For inquiries or concerns about these prerequisites, feel free to raise a PR. We are
committed to assist and guide you.
+3
View File
@@ -1,5 +1,8 @@
# count people in zone
[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-detect-and-count-objects-in-polygon-zone.ipynb)
[![YouTube](https://badges.aleen42.com/src/youtube.svg)](https://www.youtube.com/watch?v=l_kf9CfZ_8M)
## 👋 hello
This demo is a video analysis tool that counts and highlights objects in specific zones
@@ -38,15 +38,15 @@ def initiate_annotators(
) -> Tuple[
List[sv.PolygonZone], List[sv.PolygonZoneAnnotator], List[sv.BoundingBoxAnnotator]
]:
line_thickness = sv.calculate_dynamic_line_thickness(resolution_wh=resolution_wh)
text_scale = sv.calculate_dynamic_text_scale(resolution_wh=resolution_wh)
line_thickness = sv.calculate_optimal_line_thickness(resolution_wh=resolution_wh)
text_scale = sv.calculate_optimal_text_scale(resolution_wh=resolution_wh)
zones = []
zone_annotators = []
box_annotators = []
for index, polygon in enumerate(polygons):
zone = sv.PolygonZone(polygon=polygon, frame_resolution_wh=resolution_wh)
zone = sv.PolygonZone(polygon=polygon)
zone_annotator = sv.PolygonZoneAnnotator(
zone=zone,
color=COLORS.by_idx(index),
@@ -1,5 +1,5 @@
gdown
inference
supervision
inference==0.9.17
supervision>=0.20.0
tqdm
ultralytics
@@ -36,15 +36,15 @@ def initiate_annotators(
) -> Tuple[
List[sv.PolygonZone], List[sv.PolygonZoneAnnotator], List[sv.BoundingBoxAnnotator]
]:
line_thickness = sv.calculate_dynamic_line_thickness(resolution_wh=resolution_wh)
text_scale = sv.calculate_dynamic_text_scale(resolution_wh=resolution_wh)
line_thickness = sv.calculate_optimal_line_thickness(resolution_wh=resolution_wh)
text_scale = sv.calculate_optimal_text_scale(resolution_wh=resolution_wh)
zones = []
zone_annotators = []
box_annotators = []
for index, polygon in enumerate(polygons):
zone = sv.PolygonZone(polygon=polygon, frame_resolution_wh=resolution_wh)
zone = sv.PolygonZone(polygon=polygon)
zone_annotator = sv.PolygonZoneAnnotator(
zone=zone,
color=COLORS.by_idx(index),
+1 -1
View File
@@ -1,2 +1,2 @@
supervision[assets]
supervision[assets]==0.19.0
ultralytics
@@ -98,10 +98,10 @@ if __name__ == "__main__":
frame_rate=video_info.fps, track_thresh=args.confidence_threshold
)
thickness = sv.calculate_dynamic_line_thickness(
thickness = sv.calculate_optimal_line_thickness(
resolution_wh=video_info.resolution_wh
)
text_scale = sv.calculate_dynamic_text_scale(resolution_wh=video_info.resolution_wh)
text_scale = sv.calculate_optimal_text_scale(resolution_wh=video_info.resolution_wh)
bounding_box_annotator = sv.BoundingBoxAnnotator(thickness=thickness)
label_annotator = sv.LabelAnnotator(
text_scale=text_scale,
@@ -116,9 +116,7 @@ if __name__ == "__main__":
frame_generator = sv.get_video_frames_generator(source_path=args.source_video_path)
polygon_zone = sv.PolygonZone(
polygon=SOURCE, frame_resolution_wh=video_info.resolution_wh
)
polygon_zone = sv.PolygonZone(polygon=SOURCE)
view_transformer = ViewTransformer(source=SOURCE, target=TARGET)
coordinates = defaultdict(lambda: deque(maxlen=video_info.fps))
+3 -3
View File
@@ -1,6 +1,6 @@
supervision==0.18.0rc1
tqdm==4.66.1
supervision>=0.20.0
tqdm==4.66.3
requests
ultralytics==8.0.237
super-gradients==3.5.0
inference==0.9.8
inference==0.9.17
@@ -76,10 +76,10 @@ if __name__ == "__main__":
frame_rate=video_info.fps, track_thresh=args.confidence_threshold
)
thickness = sv.calculate_dynamic_line_thickness(
thickness = sv.calculate_optimal_line_thickness(
resolution_wh=video_info.resolution_wh
)
text_scale = sv.calculate_dynamic_text_scale(resolution_wh=video_info.resolution_wh)
text_scale = sv.calculate_optimal_text_scale(resolution_wh=video_info.resolution_wh)
bounding_box_annotator = sv.BoundingBoxAnnotator(thickness=thickness)
label_annotator = sv.LabelAnnotator(
text_scale=text_scale,
@@ -94,9 +94,7 @@ if __name__ == "__main__":
frame_generator = sv.get_video_frames_generator(source_path=args.source_video_path)
polygon_zone = sv.PolygonZone(
polygon=SOURCE, frame_resolution_wh=video_info.resolution_wh
)
polygon_zone = sv.PolygonZone(polygon=SOURCE)
view_transformer = ViewTransformer(source=SOURCE, target=TARGET)
coordinates = defaultdict(lambda: deque(maxlen=video_info.fps))
@@ -77,10 +77,10 @@ if __name__ == "__main__":
frame_rate=video_info.fps, track_thresh=args.confidence_threshold
)
thickness = sv.calculate_dynamic_line_thickness(
thickness = sv.calculate_optimal_line_thickness(
resolution_wh=video_info.resolution_wh
)
text_scale = sv.calculate_dynamic_text_scale(resolution_wh=video_info.resolution_wh)
text_scale = sv.calculate_optimal_text_scale(resolution_wh=video_info.resolution_wh)
bounding_box_annotator = sv.BoundingBoxAnnotator(thickness=thickness)
label_annotator = sv.LabelAnnotator(
text_scale=text_scale,
@@ -95,9 +95,7 @@ if __name__ == "__main__":
frame_generator = sv.get_video_frames_generator(source_path=args.source_video_path)
polygon_zone = sv.PolygonZone(
polygon=SOURCE, frame_resolution_wh=video_info.resolution_wh
)
polygon_zone = sv.PolygonZone(polygon=SOURCE)
view_transformer = ViewTransformer(source=SOURCE, target=TARGET)
coordinates = defaultdict(lambda: deque(maxlen=video_info.fps))
+9
View File
@@ -0,0 +1,9 @@
data/
venv*/
*.pt
*.pth
*.mp4
*.mov
*.png
*.jpg
*.jpeg
+264
View File
@@ -0,0 +1,264 @@
# time in zone
[![YouTube](https://badges.aleen42.com/src/youtube.svg)](https://www.youtube.com/watch?v=hAWpsIuem10)
## 👋 hello
Practical demonstration on leveraging computer vision for analyzing wait times and
monitoring the duration that objects or individuals spend in predefined areas of video
frames. This example project, perfect for retail analytics or traffic management
applications.
https://github.com/roboflow/supervision/assets/26109316/d051cc8a-dd15-41d4-aa36-d38b86334c39
## 💻 install
- clone repository and navigate to example directory
```bash
git clone https://github.com/roboflow/supervision.git
cd supervision/examples/time_in_zone
```
- setup python environment and activate it [optional]
```bash
python3 -m venv venv
source venv/bin/activate
```
- install required dependencies
```bash
pip install -r requirements.txt
```
## 🛠 scripts
### `download_from_youtube`
This script allows you to download a video from YouTube.
- `--url`: The full URL of the YouTube video you wish to download.
- `--output_path` (optional): Specifies the directory where the video will be saved.
- `--file_name` (optional): Sets the name of the saved video file.
```bash
python scripts/download_from_youtube.py \
--url "https://www.youtube.com/watch?v=-8zyEwAa50Q" \
--output_path "data/checkout" \
--file_name "video.mp4"
```
```bash
python scripts/download_from_youtube.py \
--url "https://www.youtube.com/watch?v=MNn9qKG2UFI" \
--output_path "data/traffic" \
--file_name "video.mp4"
```
### `stream_from_file`
This script allows you to stream video files from a directory. It's an awesome way to
mock a live video stream for local testing. Video will be streamed in a loop under
`rtsp://localhost:8554/live0.stream` URL. This script requires docker to be installed.
- `--video_directory`: Directory containing video files to stream.
- `--number_of_streams`: Number of video files to stream.
```bash
python scripts/stream_from_file.py \
--video_directory "data/checkout" \
--number_of_streams 1
```
```bash
python scripts/stream_from_file.py \
--video_directory "data/traffic" \
--number_of_streams 1
```
### `draw_zones`
If you want to test zone time in zone analysis on your own video, you can use this
script to design custom zones and save results as a JSON file. The script will open a
window where you can draw polygons on the source image or video file. The polygons will
be saved as a JSON file.
- `--source_path`: Path to the source image or video file for drawing polygons.
- `--zone_configuration_path`: Path where the polygon annotations will be saved as a JSON file.
- `enter` - finish drawing the current polygon.
- `escape` - cancel drawing the current polygon.
- `q` - quit the drawing window.
- `s` - save zone configuration to a JSON file.
```bash
python scripts/draw_zones.py \
--source_path "data/checkout/video.mp4" \
--zone_configuration_path "data/checkout/config.json"
```
```bash
python scripts/draw_zones.py \
--source_path "data/traffic/video.mp4" \
--zone_configuration_path "data/traffic/config.json"
```
https://github.com/roboflow/supervision/assets/26109316/9d514c9e-2a61-418b-ae49-6ac1ad6ae5ac
## 🎬 video & stream processing
### `inference_file_example`
Script to run object detection on a video file using the Roboflow Inference model.
- `--zone_configuration_path`: Path to the zone configuration JSON file.
- `--source_video_path`: Path to the source video file.
- `--model_id`: Roboflow model ID.
- `--classes`: List of class IDs to track. If empty, all classes are tracked.
- `--confidence_threshold`: Confidence level for detections (`0` to `1`). Default is `0.3`.
- `--iou_threshold`: IOU threshold for non-max suppression. Default is `0.7`.
```bash
python inference_file_example.py \
--zone_configuration_path "data/checkout/config.json" \
--source_video_path "data/checkout/video.mp4" \
--model_id "yolov8x-640" \
--classes 0 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
https://github.com/roboflow/supervision/assets/26109316/d051cc8a-dd15-41d4-aa36-d38b86334c39
```bash
python inference_file_example.py \
--zone_configuration_path "data/traffic/config.json" \
--source_video_path "data/traffic/video.mp4" \
--model_id "yolov8x-640" \
--classes 2 5 6 7 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
https://github.com/roboflow/supervision/assets/26109316/5ec896d7-4b39-4426-8979-11e71666878b
### `inference_stream_example`
Script to run object detection on a video stream using the Roboflow Inference model.
- `--zone_configuration_path`: Path to the zone configuration JSON file.
- `--rtsp_url`: Complete RTSP URL for the video stream.
- `--model_id`: Roboflow model ID.
- `--classes`: List of class IDs to track. If empty, all classes are tracked.
- `--confidence_threshold`: Confidence level for detections (`0` to `1`). Default is `0.3`.
- `--iou_threshold`: IOU threshold for non-max suppression. Default is `0.7`.
```bash
python inference_stream_example.py \
--zone_configuration_path "data/checkout/config.json" \
--rtsp_url "rtsp://localhost:8554/live0.stream" \
--model_id "yolov8x-640" \
--classes 0 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
```bash
python inference_stream_example.py \
--zone_configuration_path "data/traffic/config.json" \
--rtsp_url "rtsp://localhost:8554/live0.stream" \
--model_id "yolov8x-640" \
--classes 2 5 6 7 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
<details>
<summary>👉 show ultralytics examples</summary>
### `ultralytics_file_example`
Script to run object detection on a video file using the Ultralytics YOLOv8 model.
- `--zone_configuration_path`: Path to the zone configuration JSON file.
- `--source_video_path`: Path to the source video file.
- `--weights`: Path to the model weights file. Default is `'yolov8s.pt'`.
- `--device`: Computation device (`'cpu'`, `'mps'` or `'cuda'`). Default is `'cpu'`.
- `--classes`: List of class IDs to track. If empty, all classes are tracked.
- `--confidence_threshold`: Confidence level for detections (`0` to `1`). Default is `0.3`.
- `--iou_threshold`: IOU threshold for non-max suppression. Default is `0.7`.
```bash
python ultralytics_file_example.py \
--zone_configuration_path "data/checkout/config.json" \
--source_video_path "data/checkout/video.mp4" \
--weights "yolov8x.pt" \
--device "cpu" \
--classes 0 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
```bash
python ultralytics_file_example.py \
--zone_configuration_path "data/traffic/config.json" \
--source_video_path "data/traffic/video.mp4" \
--weights "yolov8x.pt" \
--device "cpu" \
--classes 2 5 6 7 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
### `ultralytics_stream_example`
Script to run object detection on a video stream using the Ultralytics YOLOv8 model.
- `--zone_configuration_path`: Path to the zone configuration JSON file.
- `--rtsp_url`: Complete RTSP URL for the video stream.
- `--weights`: Path to the model weights file. Default is `'yolov8s.pt'`.
- `--device`: Computation device (`'cpu'`, `'mps'` or `'cuda'`). Default is `'cpu'`.
- `--classes`: List of class IDs to track. If empty, all classes are tracked.
- `--confidence_threshold`: Confidence level for detections (`0` to `1`). Default is `0.3`.
- `--iou_threshold`: IOU threshold for non-max suppression. Default is `0.7`.
```bash
python ultralytics_stream_example.py \
--zone_configuration_path "data/checkout/config.json" \
--rtsp_url "rtsp://localhost:8554/live0.stream" \
--weights "yolov8x.pt" \
--device "cpu" \
--classes 0 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
```bash
python ultralytics_stream_example.py \
--zone_configuration_path "data/traffic/config.json" \
--rtsp_url "rtsp://localhost:8554/live0.stream" \
--weights "yolov8x.pt" \
--device "cpu" \
--classes 2 5 6 7 \
--confidence_threshold 0.3 \
--iou_threshold 0.7
```
</details>
## © license
This demo integrates two main components, each with its own licensing:
- ultralytics: The object detection model used in this demo, YOLOv8, is distributed
under the [AGPL-3.0 license](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
You can find more details about this license here.
- supervision: The analytics code that powers the zone-based analysis in this demo is
based on the Supervision library, which is licensed under the
[MIT license](https://github.com/roboflow/supervision/blob/develop/LICENSE.md). This
makes the Supervision part of the code fully open source and freely usable in your
projects.
@@ -0,0 +1,128 @@
import argparse
from typing import List
import cv2
import numpy as np
from inference import get_model
from utils.general import find_in_list, load_zones_config
from utils.timers import FPSBasedTimer
import supervision as sv
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS)
LABEL_ANNOTATOR = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.from_hex("#000000")
)
def main(
source_video_path: str,
zone_configuration_path: str,
model_id: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
model = get_model(model_id=model_id)
tracker = sv.ByteTrack(minimum_matching_threshold=0.5)
video_info = sv.VideoInfo.from_video_path(video_path=source_video_path)
frames_generator = sv.get_video_frames_generator(source_video_path)
polygons = load_zones_config(file_path=zone_configuration_path)
zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in polygons
]
timers = [FPSBasedTimer(video_info.fps) for _ in zones]
for frame in frames_generator:
results = model.infer(frame, confidence=confidence, iou_threshold=iou)[0]
detections = sv.Detections.from_inference(results)
detections = detections[find_in_list(detections.class_id, classes)]
detections = tracker.update_with_detections(detections)
annotated_frame = frame.copy()
for idx, zone in enumerate(zones):
annotated_frame = sv.draw_polygon(
scene=annotated_frame, polygon=zone.polygon, color=COLORS.by_idx(idx)
)
detections_in_zone = detections[zone.trigger(detections)]
time_in_zone = timers[idx].tick(detections_in_zone)
custom_color_lookup = np.full(detections_in_zone.class_id.shape, idx)
annotated_frame = COLOR_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
custom_color_lookup=custom_color_lookup,
)
labels = [
f"#{tracker_id} {int(time // 60):02d}:{int(time % 60):02d}"
for tracker_id, time in zip(detections_in_zone.tracker_id, time_in_zone)
]
annotated_frame = LABEL_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
labels=labels,
custom_color_lookup=custom_color_lookup,
)
cv2.imshow("Processed Video", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
cv2.destroyAllWindows()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Calculating detections dwell time in zones, using video file."
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path to the zone configuration JSON file.",
)
parser.add_argument(
"--source_video_path",
type=str,
required=True,
help="Path to the source video file.",
)
parser.add_argument(
"--model_id", type=str, default="yolov8s-640", help="Roboflow model ID."
)
parser.add_argument(
"--confidence_threshold",
type=float,
default=0.3,
help="Confidence level for detections (0 to 1). Default is 0.3.",
)
parser.add_argument(
"--iou_threshold",
default=0.7,
type=float,
help="IOU threshold for non-max suppression. Default is 0.7.",
)
parser.add_argument(
"--classes",
nargs="*",
type=int,
default=[],
help="List of class IDs to track. If empty, all classes are tracked.",
)
args = parser.parse_args()
main(
source_video_path=args.source_video_path,
zone_configuration_path=args.zone_configuration_path,
model_id=args.model_id,
confidence=args.confidence_threshold,
iou=args.iou_threshold,
classes=args.classes,
)
@@ -0,0 +1,138 @@
import argparse
from typing import List
import cv2
import numpy as np
from inference import get_model
from utils.general import find_in_list, get_stream_frames_generator, load_zones_config
from utils.timers import ClockBasedTimer
import supervision as sv
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS)
LABEL_ANNOTATOR = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.from_hex("#000000")
)
def main(
rtsp_url: str,
zone_configuration_path: str,
model_id: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
model = get_model(model_id=model_id)
tracker = sv.ByteTrack(minimum_matching_threshold=0.5)
frames_generator = get_stream_frames_generator(rtsp_url=rtsp_url)
fps_monitor = sv.FPSMonitor()
polygons = load_zones_config(file_path=zone_configuration_path)
zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in polygons
]
timers = [ClockBasedTimer() for _ in zones]
for frame in frames_generator:
fps_monitor.tick()
fps = fps_monitor.fps
results = model.infer(frame, confidence=confidence, iou_threshold=iou)[0]
detections = sv.Detections.from_inference(results)
detections = detections[find_in_list(detections.class_id, classes)]
detections = tracker.update_with_detections(detections)
annotated_frame = frame.copy()
annotated_frame = sv.draw_text(
scene=annotated_frame,
text=f"{fps:.1f}",
text_anchor=sv.Point(40, 30),
background_color=sv.Color.from_hex("#A351FB"),
text_color=sv.Color.from_hex("#000000"),
)
for idx, zone in enumerate(zones):
annotated_frame = sv.draw_polygon(
scene=annotated_frame, polygon=zone.polygon, color=COLORS.by_idx(idx)
)
detections_in_zone = detections[zone.trigger(detections)]
time_in_zone = timers[idx].tick(detections_in_zone)
custom_color_lookup = np.full(detections_in_zone.class_id.shape, idx)
annotated_frame = COLOR_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
custom_color_lookup=custom_color_lookup,
)
labels = [
f"#{tracker_id} {int(time // 60):02d}:{int(time % 60):02d}"
for tracker_id, time in zip(detections_in_zone.tracker_id, time_in_zone)
]
annotated_frame = LABEL_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
labels=labels,
custom_color_lookup=custom_color_lookup,
)
cv2.imshow("Processed Video", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
cv2.destroyAllWindows()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Calculating detections dwell time in zones, using RTSP stream."
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path to the zone configuration JSON file.",
)
parser.add_argument(
"--rtsp_url",
type=str,
required=True,
help="Complete RTSP URL for the video stream.",
)
parser.add_argument(
"--model_id", type=str, default="yolov8s-640", help="Roboflow model ID."
)
parser.add_argument(
"--confidence_threshold",
type=float,
default=0.3,
help="Confidence level for detections (0 to 1). Default is 0.3.",
)
parser.add_argument(
"--iou_threshold",
default=0.7,
type=float,
help="IOU threshold for non-max suppression. Default is 0.7.",
)
parser.add_argument(
"--classes",
nargs="*",
type=int,
default=[],
help="List of class IDs to track. If empty, all classes are tracked.",
)
args = parser.parse_args()
main(
rtsp_url=args.rtsp_url,
zone_configuration_path=args.zone_configuration_path,
model_id=args.model_id,
confidence=args.confidence_threshold,
iou=args.iou_threshold,
classes=args.classes,
)
@@ -0,0 +1,153 @@
import argparse
from typing import List
import cv2
import numpy as np
from inference import InferencePipeline
from inference.core.interfaces.camera.entities import VideoFrame
from utils.general import find_in_list, load_zones_config
from utils.timers import ClockBasedTimer
import supervision as sv
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS)
LABEL_ANNOTATOR = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.from_hex("#000000")
)
class CustomSink:
def __init__(self, zone_configuration_path: str, classes: List[int]):
self.classes = classes
self.tracker = sv.ByteTrack(minimum_matching_threshold=0.5)
self.fps_monitor = sv.FPSMonitor()
self.polygons = load_zones_config(file_path=zone_configuration_path)
self.timers = [ClockBasedTimer() for _ in self.polygons]
self.zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in self.polygons
]
def on_prediction(self, result: dict, frame: VideoFrame) -> None:
self.fps_monitor.tick()
fps = self.fps_monitor.fps
detections = sv.Detections.from_inference(result)
detections = detections[find_in_list(detections.class_id, self.classes)]
detections = self.tracker.update_with_detections(detections)
annotated_frame = frame.image.copy()
annotated_frame = sv.draw_text(
scene=annotated_frame,
text=f"{fps:.1f}",
text_anchor=sv.Point(40, 30),
background_color=sv.Color.from_hex("#A351FB"),
text_color=sv.Color.from_hex("#000000"),
)
for idx, zone in enumerate(self.zones):
annotated_frame = sv.draw_polygon(
scene=annotated_frame, polygon=zone.polygon, color=COLORS.by_idx(idx)
)
detections_in_zone = detections[zone.trigger(detections)]
time_in_zone = self.timers[idx].tick(detections_in_zone)
custom_color_lookup = np.full(detections_in_zone.class_id.shape, idx)
annotated_frame = COLOR_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
custom_color_lookup=custom_color_lookup,
)
labels = [
f"#{tracker_id} {int(time // 60):02d}:{int(time % 60):02d}"
for tracker_id, time in zip(detections_in_zone.tracker_id, time_in_zone)
]
annotated_frame = LABEL_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
labels=labels,
custom_color_lookup=custom_color_lookup,
)
cv2.imshow("Processed Video", annotated_frame)
cv2.waitKey(1)
def main(
rtsp_url: str,
zone_configuration_path: str,
model_id: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
sink = CustomSink(zone_configuration_path=zone_configuration_path, classes=classes)
pipeline = InferencePipeline.init(
model_id=model_id,
video_reference=rtsp_url,
on_prediction=sink.on_prediction,
confidence=confidence,
iou_threshold=iou,
)
pipeline.start()
try:
pipeline.join()
except KeyboardInterrupt:
pipeline.terminate()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Calculating detections dwell time in zones, using RTSP stream."
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path to the zone configuration JSON file.",
)
parser.add_argument(
"--rtsp_url",
type=str,
required=True,
help="Complete RTSP URL for the video stream.",
)
parser.add_argument(
"--model_id", type=str, default="yolov8s-640", help="Roboflow model ID."
)
parser.add_argument(
"--confidence_threshold",
type=float,
default=0.3,
help="Confidence level for detections (0 to 1). Default is 0.3.",
)
parser.add_argument(
"--iou_threshold",
default=0.7,
type=float,
help="IOU threshold for non-max suppression. Default is 0.7.",
)
parser.add_argument(
"--classes",
nargs="*",
type=int,
default=[],
help="List of class IDs to track. If empty, all classes are tracked.",
)
args = parser.parse_args()
main(
rtsp_url=args.rtsp_url,
zone_configuration_path=args.zone_configuration_path,
model_id=args.model_id,
confidence=args.confidence_threshold,
iou=args.iou_threshold,
classes=args.classes,
)
+5
View File
@@ -0,0 +1,5 @@
opencv-python
supervision>=0.20.0
ultralytics
inference==0.9.17
pytube
@@ -0,0 +1,46 @@
import argparse
import os
from typing import Optional
from pytube import YouTube
def main(url: str, output_path: Optional[str], file_name: Optional[str]) -> None:
yt = YouTube(url)
stream = yt.streams.get_highest_resolution()
if not os.path.exists(output_path):
os.makedirs(output_path)
stream.download(output_path=output_path, filename=file_name)
final_name = file_name if file_name else yt.title
final_path = output_path if output_path else "current directory"
print(f"Download completed! Video saved as '{final_name}' in '{final_path}'.")
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Download a specific YouTube video by providing its URL."
)
parser.add_argument(
"--url",
type=str,
required=True,
help="The full URL of the YouTube video you wish to download.",
)
parser.add_argument(
"--output_path",
type=str,
default="data/source",
required=False,
help="Optional. Specifies the directory where the video will be saved.",
)
parser.add_argument(
"--file_name",
type=str,
default="video.mp4",
required=False,
help="Optional. Sets the name of the saved video file.",
)
args = parser.parse_args()
main(url=args.url, output_path=args.output_path, file_name=args.file_name)
+176
View File
@@ -0,0 +1,176 @@
import argparse
import json
import os
from typing import Any, Optional, Tuple
import cv2
import numpy as np
import supervision as sv
KEY_ENTER = 13
KEY_NEWLINE = 10
KEY_ESCAPE = 27
KEY_QUIT = ord("q")
KEY_SAVE = ord("s")
THICKNESS = 2
COLORS = sv.ColorPalette.DEFAULT
WINDOW_NAME = "Draw Zones"
POLYGONS = [[]]
current_mouse_position: Optional[Tuple[int, int]] = None
def resolve_source(source_path: str) -> Optional[np.ndarray]:
if not os.path.exists(source_path):
return None
image = cv2.imread(source_path)
if image is not None:
return image
frame_generator = sv.get_video_frames_generator(source_path=source_path)
frame = next(frame_generator)
return frame
def mouse_event(event: int, x: int, y: int, flags: int, param: Any) -> None:
global current_mouse_position
if event == cv2.EVENT_MOUSEMOVE:
current_mouse_position = (x, y)
elif event == cv2.EVENT_LBUTTONDOWN:
POLYGONS[-1].append((x, y))
def redraw(image: np.ndarray, original_image: np.ndarray) -> None:
global POLYGONS, current_mouse_position
image[:] = original_image.copy()
for idx, polygon in enumerate(POLYGONS):
color = (
COLORS.by_idx(idx).as_bgr()
if idx < len(POLYGONS) - 1
else sv.Color.WHITE.as_bgr()
)
if len(polygon) > 1:
for i in range(1, len(polygon)):
cv2.line(
img=image,
pt1=polygon[i - 1],
pt2=polygon[i],
color=color,
thickness=THICKNESS,
)
if idx < len(POLYGONS) - 1:
cv2.line(
img=image,
pt1=polygon[-1],
pt2=polygon[0],
color=color,
thickness=THICKNESS,
)
if idx == len(POLYGONS) - 1 and current_mouse_position is not None and polygon:
cv2.line(
img=image,
pt1=polygon[-1],
pt2=current_mouse_position,
color=color,
thickness=THICKNESS,
)
cv2.imshow(WINDOW_NAME, image)
def close_and_finalize_polygon(image: np.ndarray, original_image: np.ndarray) -> None:
if len(POLYGONS[-1]) > 2:
cv2.line(
img=image,
pt1=POLYGONS[-1][-1],
pt2=POLYGONS[-1][0],
color=COLORS.by_idx(0).as_bgr(),
thickness=THICKNESS,
)
POLYGONS.append([])
image[:] = original_image.copy()
redraw_polygons(image)
cv2.imshow(WINDOW_NAME, image)
def redraw_polygons(image: np.ndarray) -> None:
for idx, polygon in enumerate(POLYGONS[:-1]):
if len(polygon) > 1:
color = COLORS.by_idx(idx).as_bgr()
for i in range(len(polygon) - 1):
cv2.line(
img=image,
pt1=polygon[i],
pt2=polygon[i + 1],
color=color,
thickness=THICKNESS,
)
cv2.line(
img=image,
pt1=polygon[-1],
pt2=polygon[0],
color=color,
thickness=THICKNESS,
)
def save_polygons_to_json(polygons, target_path):
data_to_save = polygons if polygons[-1] else polygons[:-1]
with open(target_path, "w") as f:
json.dump(data_to_save, f)
def main(source_path: str, zone_configuration_path: str) -> None:
global current_mouse_position
original_image = resolve_source(source_path=source_path)
if original_image is None:
print("Failed to load source image.")
return
image = original_image.copy()
cv2.imshow(WINDOW_NAME, image)
cv2.setMouseCallback(WINDOW_NAME, mouse_event, image)
while True:
key = cv2.waitKey(1) & 0xFF
if key == KEY_ENTER or key == KEY_NEWLINE:
close_and_finalize_polygon(image, original_image)
elif key == KEY_ESCAPE:
POLYGONS[-1] = []
current_mouse_position = None
elif key == KEY_SAVE:
save_polygons_to_json(POLYGONS, zone_configuration_path)
print(f"Polygons saved to {zone_configuration_path}")
break
redraw(image, original_image)
if key == KEY_QUIT:
break
cv2.destroyAllWindows()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Interactively draw polygons on images or video frames and save "
"the annotations."
)
parser.add_argument(
"--source_path",
type=str,
required=True,
help="Path to the source image or video file for drawing polygons.",
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path where the polygon annotations will be saved as a JSON file.",
)
arguments = parser.parse_args()
main(
source_path=arguments.source_path,
zone_configuration_path=arguments.zone_configuration_path,
)
@@ -0,0 +1,104 @@
import argparse
import os
import subprocess
import tempfile
from glob import glob
from threading import Thread
import yaml
SERVER_CONFIG = {"protocols": ["tcp"], "paths": {"all": {"source": "publisher"}}}
BASE_STREAM_URL = "rtsp://localhost:8554/live"
def main(video_directory: str, number_of_streams: int) -> None:
video_files = find_video_files_in_directory(video_directory, number_of_streams)
try:
with tempfile.TemporaryDirectory() as temporary_directory:
config_file_path = create_server_config_file(temporary_directory)
run_rtsp_server(config_path=config_file_path)
stream_videos(video_files)
finally:
stop_rtsp_server()
def find_video_files_in_directory(directory: str, limit: int) -> list:
video_formats = ["*.mp4", "*.webm"]
video_paths = []
for video_format in video_formats:
video_paths.extend(glob(os.path.join(directory, video_format)))
return video_paths[:limit]
def create_server_config_file(directory: str) -> str:
config_path = os.path.join(directory, "rtsp-simple-server.yml")
with open(config_path, "w") as config_file:
yaml.dump(SERVER_CONFIG, config_file)
return config_path
def run_rtsp_server(config_path: str) -> None:
command = (
"docker run --rm --name rtsp_server -d -v "
f"{config_path}:/rtsp-simple-server.yml -p 8554:8554 "
"aler9/rtsp-simple-server:v1.3.0"
)
if run_command(command.split()) != 0:
raise RuntimeError("Could not start the RTSP server!")
def stop_rtsp_server() -> None:
run_command("docker kill rtsp_server".split())
def stream_videos(video_files: list) -> None:
threads = []
for index, video_file in enumerate(video_files):
stream_url = f"{BASE_STREAM_URL}{index}.stream"
print(f"Streaming {video_file} under {stream_url}")
thread = stream_video_to_url(video_file, stream_url)
threads.append(thread)
for thread in threads:
thread.join()
def stream_video_to_url(video_path: str, stream_url: str) -> Thread:
command = (
f"ffmpeg -re -stream_loop -1 -i {video_path} "
f"-f rtsp -rtsp_transport tcp {stream_url}"
)
return run_command_in_thread(command.split())
def run_command_in_thread(command: list) -> Thread:
thread = Thread(target=run_command, args=(command,))
thread.start()
return thread
def run_command(command: list) -> int:
process = subprocess.run(command)
return process.returncode
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Script to stream videos using RTSP protocol."
)
parser.add_argument(
"--video_directory",
type=str,
required=True,
help="Directory containing video files to stream.",
)
parser.add_argument(
"--number_of_streams",
type=int,
default=6,
help="Number of video files to stream.",
)
arguments = parser.parse_args()
main(
video_directory=arguments.video_directory,
number_of_streams=arguments.number_of_streams,
)
@@ -0,0 +1,140 @@
import argparse
from typing import List
import cv2
import numpy as np
from ultralytics import YOLO
from utils.general import find_in_list, load_zones_config
from utils.timers import FPSBasedTimer
import supervision as sv
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS)
LABEL_ANNOTATOR = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.from_hex("#000000")
)
def main(
source_video_path: str,
zone_configuration_path: str,
weights: str,
device: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
model = YOLO(weights)
tracker = sv.ByteTrack(minimum_matching_threshold=0.5)
video_info = sv.VideoInfo.from_video_path(video_path=source_video_path)
frames_generator = sv.get_video_frames_generator(source_video_path)
polygons = load_zones_config(file_path=zone_configuration_path)
zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in polygons
]
timers = [FPSBasedTimer(video_info.fps) for _ in zones]
for frame in frames_generator:
results = model(frame, verbose=False, device=device, conf=confidence)[0]
detections = sv.Detections.from_ultralytics(results)
detections = detections[find_in_list(detections.class_id, classes)]
detections = detections.with_nms(threshold=iou)
detections = tracker.update_with_detections(detections)
annotated_frame = frame.copy()
for idx, zone in enumerate(zones):
annotated_frame = sv.draw_polygon(
scene=annotated_frame, polygon=zone.polygon, color=COLORS.by_idx(idx)
)
detections_in_zone = detections[zone.trigger(detections)]
time_in_zone = timers[idx].tick(detections_in_zone)
custom_color_lookup = np.full(detections_in_zone.class_id.shape, idx)
annotated_frame = COLOR_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
custom_color_lookup=custom_color_lookup,
)
labels = [
f"#{tracker_id} {int(time // 60):02d}:{int(time % 60):02d}"
for tracker_id, time in zip(detections_in_zone.tracker_id, time_in_zone)
]
annotated_frame = LABEL_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
labels=labels,
custom_color_lookup=custom_color_lookup,
)
cv2.imshow("Processed Video", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
cv2.destroyAllWindows()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Calculating detections dwell time in zones, using video file."
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path to the zone configuration JSON file.",
)
parser.add_argument(
"--source_video_path",
type=str,
required=True,
help="Path to the source video file.",
)
parser.add_argument(
"--weights",
type=str,
default="yolov8s.pt",
help="Path to the model weights file. Default is 'yolov8s.pt'.",
)
parser.add_argument(
"--device",
type=str,
default="cpu",
help="Computation device ('cpu', 'mps' or 'cuda'). Default is 'cpu'.",
)
parser.add_argument(
"--confidence_threshold",
type=float,
default=0.3,
help="Confidence level for detections (0 to 1). Default is 0.3.",
)
parser.add_argument(
"--iou_threshold",
default=0.7,
type=float,
help="IOU threshold for non-max suppression. Default is 0.7.",
)
parser.add_argument(
"--classes",
nargs="*",
type=int,
default=[],
help="List of class IDs to track. If empty, all classes are tracked.",
)
args = parser.parse_args()
main(
source_video_path=args.source_video_path,
zone_configuration_path=args.zone_configuration_path,
weights=args.weights,
device=args.device,
confidence=args.confidence_threshold,
iou=args.iou_threshold,
classes=args.classes,
)
@@ -0,0 +1,150 @@
import argparse
from typing import List
import cv2
import numpy as np
from ultralytics import YOLO
from utils.general import find_in_list, get_stream_frames_generator, load_zones_config
from utils.timers import ClockBasedTimer
import supervision as sv
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS)
LABEL_ANNOTATOR = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.from_hex("#000000")
)
def main(
rtsp_url: str,
zone_configuration_path: str,
weights: str,
device: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
model = YOLO(weights)
tracker = sv.ByteTrack(minimum_matching_threshold=0.5)
frames_generator = get_stream_frames_generator(rtsp_url=rtsp_url)
fps_monitor = sv.FPSMonitor()
polygons = load_zones_config(file_path=zone_configuration_path)
zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in polygons
]
timers = [ClockBasedTimer() for _ in zones]
for frame in frames_generator:
fps_monitor.tick()
fps = fps_monitor.fps
results = model(frame, verbose=False, device=device, conf=confidence)[0]
detections = sv.Detections.from_ultralytics(results)
detections = detections[find_in_list(detections.class_id, classes)]
detections = detections.with_nms(threshold=iou)
detections = tracker.update_with_detections(detections)
annotated_frame = frame.copy()
annotated_frame = sv.draw_text(
scene=annotated_frame,
text=f"{fps:.1f}",
text_anchor=sv.Point(40, 30),
background_color=sv.Color.from_hex("#A351FB"),
text_color=sv.Color.from_hex("#000000"),
)
for idx, zone in enumerate(zones):
annotated_frame = sv.draw_polygon(
scene=annotated_frame, polygon=zone.polygon, color=COLORS.by_idx(idx)
)
detections_in_zone = detections[zone.trigger(detections)]
time_in_zone = timers[idx].tick(detections_in_zone)
custom_color_lookup = np.full(detections_in_zone.class_id.shape, idx)
annotated_frame = COLOR_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
custom_color_lookup=custom_color_lookup,
)
labels = [
f"#{tracker_id} {int(time // 60):02d}:{int(time % 60):02d}"
for tracker_id, time in zip(detections_in_zone.tracker_id, time_in_zone)
]
annotated_frame = LABEL_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
labels=labels,
custom_color_lookup=custom_color_lookup,
)
cv2.imshow("Processed Video", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
cv2.destroyAllWindows()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Calculating detections dwell time in zones, using RTSP stream."
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path to the zone configuration JSON file.",
)
parser.add_argument(
"--rtsp_url",
type=str,
required=True,
help="Complete RTSP URL for the video stream.",
)
parser.add_argument(
"--weights",
type=str,
default="yolov8s.pt",
help="Path to the model weights file. Default is 'yolov8s.pt'.",
)
parser.add_argument(
"--device",
type=str,
default="cpu",
help="Computation device ('cpu', 'mps' or 'cuda'). Default is 'cpu'.",
)
parser.add_argument(
"--confidence_threshold",
type=float,
default=0.3,
help="Confidence level for detections (0 to 1). Default is 0.3.",
)
parser.add_argument(
"--iou_threshold",
default=0.7,
type=float,
help="IOU threshold for non-max suppression. Default is 0.7.",
)
parser.add_argument(
"--classes",
nargs="*",
type=int,
default=[],
help="List of class IDs to track. If empty, all classes are tracked.",
)
args = parser.parse_args()
main(
rtsp_url=args.rtsp_url,
zone_configuration_path=args.zone_configuration_path,
weights=args.weights,
device=args.device,
confidence=args.confidence_threshold,
iou=args.iou_threshold,
classes=args.classes,
)
@@ -0,0 +1,168 @@
import argparse
from typing import List
import cv2
import numpy as np
from inference import InferencePipeline
from inference.core.interfaces.camera.entities import VideoFrame
from ultralytics import YOLO
from utils.general import find_in_list, load_zones_config
from utils.timers import ClockBasedTimer
import supervision as sv
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
COLOR_ANNOTATOR = sv.ColorAnnotator(color=COLORS)
LABEL_ANNOTATOR = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.from_hex("#000000")
)
class CustomSink:
def __init__(self, zone_configuration_path: str, classes: List[int]):
self.classes = classes
self.tracker = sv.ByteTrack(minimum_matching_threshold=0.8)
self.fps_monitor = sv.FPSMonitor()
self.polygons = load_zones_config(file_path=zone_configuration_path)
self.timers = [ClockBasedTimer() for _ in self.polygons]
self.zones = [
sv.PolygonZone(
polygon=polygon,
triggering_anchors=(sv.Position.CENTER,),
)
for polygon in self.polygons
]
def on_prediction(self, detections: sv.Detections, frame: VideoFrame) -> None:
self.fps_monitor.tick()
fps = self.fps_monitor.fps
detections = detections[find_in_list(detections.class_id, self.classes)]
detections = self.tracker.update_with_detections(detections)
annotated_frame = frame.image.copy()
annotated_frame = sv.draw_text(
scene=annotated_frame,
text=f"{fps:.1f}",
text_anchor=sv.Point(40, 30),
background_color=sv.Color.from_hex("#A351FB"),
text_color=sv.Color.from_hex("#000000"),
)
for idx, zone in enumerate(self.zones):
annotated_frame = sv.draw_polygon(
scene=annotated_frame, polygon=zone.polygon, color=COLORS.by_idx(idx)
)
detections_in_zone = detections[zone.trigger(detections)]
time_in_zone = self.timers[idx].tick(detections_in_zone)
custom_color_lookup = np.full(detections_in_zone.class_id.shape, idx)
annotated_frame = COLOR_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
custom_color_lookup=custom_color_lookup,
)
labels = [
f"#{tracker_id} {int(time // 60):02d}:{int(time % 60):02d}"
for tracker_id, time in zip(detections_in_zone.tracker_id, time_in_zone)
]
annotated_frame = LABEL_ANNOTATOR.annotate(
scene=annotated_frame,
detections=detections_in_zone,
labels=labels,
custom_color_lookup=custom_color_lookup,
)
cv2.imshow("Processed Video", annotated_frame)
cv2.waitKey(1)
def main(
rtsp_url: str,
zone_configuration_path: str,
weights: str,
device: str,
confidence: float,
iou: float,
classes: List[int],
) -> None:
model = YOLO(weights)
def inference_callback(frame: VideoFrame) -> sv.Detections:
results = model(frame.image, verbose=False, conf=confidence, device=device)[0]
return sv.Detections.from_ultralytics(results).with_nms(threshold=iou)
sink = CustomSink(zone_configuration_path=zone_configuration_path, classes=classes)
pipeline = InferencePipeline.init_with_custom_logic(
video_reference=rtsp_url,
on_video_frame=inference_callback,
on_prediction=sink.on_prediction,
)
pipeline.start()
try:
pipeline.join()
except KeyboardInterrupt:
pipeline.terminate()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Calculating detections dwell time in zones, using RTSP stream."
)
parser.add_argument(
"--zone_configuration_path",
type=str,
required=True,
help="Path to the zone configuration JSON file.",
)
parser.add_argument(
"--rtsp_url",
type=str,
required=True,
help="Complete RTSP URL for the video stream.",
)
parser.add_argument(
"--weights",
type=str,
default="yolov8s.pt",
help="Path to the model weights file. Default is 'yolov8s.pt'.",
)
parser.add_argument(
"--device",
type=str,
default="cpu",
help="Computation device ('cpu', 'mps' or 'cuda'). Default is 'cpu'.",
)
parser.add_argument(
"--confidence_threshold",
type=float,
default=0.3,
help="Confidence level for detections (0 to 1). Default is 0.3.",
)
parser.add_argument(
"--iou_threshold",
default=0.7,
type=float,
help="IOU threshold for non-max suppression. Default is 0.7.",
)
parser.add_argument(
"--classes",
nargs="*",
type=int,
default=[],
help="List of class IDs to track. If empty, all classes are tracked.",
)
args = parser.parse_args()
main(
rtsp_url=args.rtsp_url,
zone_configuration_path=args.zone_configuration_path,
weights=args.weights,
device=args.device,
confidence=args.confidence_threshold,
iou=args.iou_threshold,
classes=args.classes,
)
+66
View File
@@ -0,0 +1,66 @@
import json
from typing import Generator, List
import cv2
import numpy as np
def load_zones_config(file_path: str) -> List[np.ndarray]:
"""
Load polygon zone configurations from a JSON file.
This function reads a JSON file which contains polygon coordinates, and
converts them into a list of NumPy arrays. Each polygon is represented as
a NumPy array of coordinates.
Args:
file_path (str): The path to the JSON configuration file.
Returns:
List[np.ndarray]: A list of polygons, each represented as a NumPy array.
"""
with open(file_path, "r") as file:
data = json.load(file)
return [np.array(polygon, np.int32) for polygon in data]
def find_in_list(array: np.ndarray, search_list: List[int]) -> np.ndarray:
"""Determines if elements of a numpy array are present in a list.
Args:
array (np.ndarray): The numpy array of integers to check.
search_list (List[int]): The list of integers to search within.
Returns:
np.ndarray: A numpy array of booleans, where each boolean indicates whether
the corresponding element in `array` is found in `search_list`.
"""
if not search_list:
return np.ones(array.shape, dtype=bool)
else:
return np.isin(array, search_list)
def get_stream_frames_generator(rtsp_url: str) -> Generator[np.ndarray, None, None]:
"""
Generator function to yield frames from an RTSP stream.
Args:
rtsp_url (str): URL of the RTSP video stream.
Yields:
np.ndarray: The next frame from the video stream.
"""
cap = cv2.VideoCapture(rtsp_url)
if not cap.isOpened():
raise Exception("Error: Could not open video stream.")
try:
while True:
ret, frame = cap.read()
if not ret:
print("End of stream or error reading frame.")
break
yield frame
finally:
cap.release()
+88
View File
@@ -0,0 +1,88 @@
from datetime import datetime
from typing import Dict
import numpy as np
import supervision as sv
class FPSBasedTimer:
"""
A timer that calculates the duration each object has been detected based on frames
per second (FPS).
Attributes:
fps (int): The frame rate of the video stream, used to calculate time durations.
frame_id (int): The current frame number in the sequence.
tracker_id2frame_id (Dict[int, int]): Maps each tracker's ID to the frame number
at which it was first detected.
"""
def __init__(self, fps: int = 30) -> None:
"""Initializes the FPSBasedTimer with the specified frames per second rate.
Args:
fps (int, optional): The frame rate of the video stream. Defaults to 30.
"""
self.fps = fps
self.frame_id = 0
self.tracker_id2frame_id: Dict[int, int] = {}
def tick(self, detections: sv.Detections) -> np.ndarray:
"""Processes the current frame, updating time durations for each tracker.
Args:
detections: The detections for the current frame, including tracker IDs.
Returns:
np.ndarray: Time durations (in seconds) for each detected tracker, since
their first detection.
"""
self.frame_id += 1
times = []
for tracker_id in detections.tracker_id:
self.tracker_id2frame_id.setdefault(tracker_id, self.frame_id)
start_frame_id = self.tracker_id2frame_id[tracker_id]
time_duration = (self.frame_id - start_frame_id) / self.fps
times.append(time_duration)
return np.array(times)
class ClockBasedTimer:
"""
A timer that calculates the duration each object has been detected based on the
system clock.
Attributes:
tracker_id2start_time (Dict[int, datetime]): Maps each tracker's ID to the
datetime when it was first detected.
"""
def __init__(self) -> None:
"""Initializes the ClockBasedTimer."""
self.tracker_id2start_time: Dict[int, datetime] = {}
def tick(self, detections: sv.Detections) -> np.ndarray:
"""Processes the current frame, updating time durations for each tracker.
Args:
detections: The detections for the current frame, including tracker IDs.
Returns:
np.ndarray: Time durations (in seconds) for each detected tracker, since
their first detection.
"""
current_time = datetime.now()
times = []
for tracker_id in detections.tracker_id:
self.tracker_id2start_time.setdefault(tracker_id, current_time)
start_time = self.tracker_id2start_time[tracker_id]
time_duration = (current_time - start_time).total_seconds()
times.append(time_duration)
return np.array(times)
+2 -2
View File
@@ -1,4 +1,4 @@
inference
supervision
inference==0.9.17
supervision==0.19.0
tqdm
ultralytics
+16 -15
View File
@@ -1,6 +1,6 @@
import argparse
import os
from typing import Dict, List, Set, Tuple
from typing import Dict, Iterable, List, Set
import cv2
import numpy as np
@@ -9,7 +9,8 @@ from tqdm import tqdm
import supervision as sv
COLORS = sv.ColorPalette.default()
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
ZONE_IN_POLYGONS = [
np.array([[592, 282], [900, 282], [900, 82], [592, 82]]),
@@ -59,14 +60,12 @@ class DetectionsManager:
def initiate_polygon_zones(
polygons: List[np.ndarray],
frame_resolution_wh: Tuple[int, int],
triggering_position: sv.Position = sv.Position.CENTER,
triggering_anchors: Iterable[sv.Position] = [sv.Position.CENTER],
) -> List[sv.PolygonZone]:
return [
sv.PolygonZone(
polygon=polygon,
frame_resolution_wh=frame_resolution_wh,
triggering_position=triggering_position,
triggering_anchors=triggering_anchors,
)
for polygon in polygons
]
@@ -91,14 +90,13 @@ class VideoProcessor:
self.tracker = sv.ByteTrack()
self.video_info = sv.VideoInfo.from_video_path(source_video_path)
self.zones_in = initiate_polygon_zones(
ZONE_IN_POLYGONS, self.video_info.resolution_wh, sv.Position.CENTER
)
self.zones_out = initiate_polygon_zones(
ZONE_OUT_POLYGONS, self.video_info.resolution_wh, sv.Position.CENTER
)
self.zones_in = initiate_polygon_zones(ZONE_IN_POLYGONS, [sv.Position.CENTER])
self.zones_out = initiate_polygon_zones(ZONE_OUT_POLYGONS, [sv.Position.CENTER])
self.box_annotator = sv.BoxAnnotator(color=COLORS)
self.bounding_box_annotator = sv.BoundingBoxAnnotator(color=COLORS)
self.label_annotator = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.BLACK
)
self.trace_annotator = sv.TraceAnnotator(
color=COLORS, position=sv.Position.CENTER, trace_length=100, thickness=2
)
@@ -136,7 +134,10 @@ class VideoProcessor:
labels = [f"#{tracker_id}" for tracker_id in detections.tracker_id]
annotated_frame = self.trace_annotator.annotate(annotated_frame, detections)
annotated_frame = self.box_annotator.annotate(
annotated_frame = self.bounding_box_annotator.annotate(
annotated_frame, detections
)
annotated_frame = self.label_annotator.annotate(
annotated_frame, detections, labels
)
@@ -167,7 +168,7 @@ class VideoProcessor:
detections_in_zones = []
detections_out_zones = []
for i, (zone_in, zone_out) in enumerate(zip(self.zones_in, self.zones_out)):
for zone_in, zone_out in zip(self.zones_in, self.zones_out):
detections_in_zone = detections[zone_in.trigger(detections=detections)]
detections_in_zones.append(detections_in_zone)
detections_out_zone = detections[zone_out.trigger(detections=detections)]
+2 -2
View File
@@ -1,5 +1,5 @@
gdown
inference
supervision
inference==0.9.17
supervision>=0.20.0
tqdm
ultralytics
@@ -1,5 +1,5 @@
import argparse
from typing import Dict, List, Set, Tuple
from typing import Dict, Iterable, List, Set
import cv2
import numpy as np
@@ -8,7 +8,7 @@ from ultralytics import YOLO
import supervision as sv
COLORS = sv.ColorPalette.default()
COLORS = sv.ColorPalette.from_hex(["#E6194B", "#3CB44B", "#FFE119", "#3C76D1"])
ZONE_IN_POLYGONS = [
np.array([[592, 282], [900, 282], [900, 82], [592, 82]]),
@@ -58,14 +58,12 @@ class DetectionsManager:
def initiate_polygon_zones(
polygons: List[np.ndarray],
frame_resolution_wh: Tuple[int, int],
triggering_position: sv.Position = sv.Position.CENTER,
triggering_anchors: Iterable[sv.Position] = [sv.Position.CENTER],
) -> List[sv.PolygonZone]:
return [
sv.PolygonZone(
polygon=polygon,
frame_resolution_wh=frame_resolution_wh,
triggering_position=triggering_position,
triggering_anchors=triggering_anchors,
)
for polygon in polygons
]
@@ -89,14 +87,13 @@ class VideoProcessor:
self.tracker = sv.ByteTrack()
self.video_info = sv.VideoInfo.from_video_path(source_video_path)
self.zones_in = initiate_polygon_zones(
ZONE_IN_POLYGONS, self.video_info.resolution_wh, sv.Position.CENTER
)
self.zones_out = initiate_polygon_zones(
ZONE_OUT_POLYGONS, self.video_info.resolution_wh, sv.Position.CENTER
)
self.zones_in = initiate_polygon_zones(ZONE_IN_POLYGONS, [sv.Position.CENTER])
self.zones_out = initiate_polygon_zones(ZONE_OUT_POLYGONS, [sv.Position.CENTER])
self.box_annotator = sv.BoxAnnotator(color=COLORS)
self.bounding_box_annotator = sv.BoundingBoxAnnotator(color=COLORS)
self.label_annotator = sv.LabelAnnotator(
color=COLORS, text_color=sv.Color.BLACK
)
self.trace_annotator = sv.TraceAnnotator(
color=COLORS, position=sv.Position.CENTER, trace_length=100, thickness=2
)
@@ -134,7 +131,10 @@ class VideoProcessor:
labels = [f"#{tracker_id}" for tracker_id in detections.tracker_id]
annotated_frame = self.trace_annotator.annotate(annotated_frame, detections)
annotated_frame = self.box_annotator.annotate(
annotated_frame = self.bounding_box_annotator.annotate(
annotated_frame, detections
)
annotated_frame = self.label_annotator.annotate(
annotated_frame, detections, labels
)
@@ -165,7 +165,7 @@ class VideoProcessor:
detections_in_zones = []
detections_out_zones = []
for i, (zone_in, zone_out) in enumerate(zip(self.zones_in, self.zones_out)):
for zone_in, zone_out in zip(self.zones_in, self.zones_out):
detections_in_zone = detections[zone_in.trigger(detections=detections)]
detections_in_zones.append(detections_in_zone)
detections_out_zone = detections[zone_out.trigger(detections=detections)]
+63 -26
View File
@@ -31,55 +31,75 @@ extra:
extra_css:
- stylesheets/extra.css
- stylesheets/cookbooks-card.css
nav:
- Home: index.md
- How to:
- Supervision: index.md
- Learn:
- Detect and Annotate: how_to/detect_and_annotate.md
- Track Objects: how_to/track_objects.md
- Save Detections: how_to/save_detections.md
- Filter Detections: how_to/filter_detections.md
- API:
- Classifications:
- Core: classification/core.md
- Detections:
- Detect Small Objects: how_to/detect_small_objects.md
- Track Objects on Video: how_to/track_objects.md
- Reference - Code API:
- Detection and Segmentation:
- Core: detection/core.md
- Annotators: detection/annotators.md
- Metrics: detection/metrics.md
- Double Detection Filter: detection/double_detection_filter.md
- Utils: detection/utils.md
- Keypoint Detection:
- Core: keypoint/core.md
- Annotators: keypoint/annotators.md
- Classification:
- Core: classification/core.md
- Tools:
- Line Zone: detection/tools/line_zone.md
- Polygon Zone: detection/tools/polygon_zone.md
- Inference Slicer: detection/tools/inference_slicer.md
- Detection Smoother: detection/tools/smoother.md
- Save Detections: detection/tools/save_detections.md
- Annotators: annotators.md
- Trackers: trackers.md
- Datasets: datasets.md
- Metrics:
- Object Detection: metrics/detection.md
- Draw:
- Color: draw/color.md
- Utils: draw/utils.md
- Geometry:
- Position: geometry/core.md
- Datasets:
- Core: datasets/core.md
- Utils: datasets/utils.md
- Utils:
- Video: utils/video.md
- Image: utils/image.md
- Iterables: utils/iterables.md
- Notebook: utils/notebook.md
- File: utils/file.md
- Assets: assets.md
- Development:
- Draw: utils/draw.md
- Geometry: utils/geometry.md
- Assets: assets.md
- Cookbooks: cookbooks.md
- Contribute:
- Contributing: contributing.md
- Code of Conduct: code_of_conduct.md
- Changelog:
- License: license.md
- Release Notes:
- Changelog: changelog.md
- Deprecated: deprecated.md
- License: license.md
theme:
name: 'material'
icon:
edit: material/pencil
logo: assets/supervision-lenny.png
favicon: assets/supervision-lenny.png
custom_dir: docs/theme
features:
- navigation.tracking
- content.code.copy
- content.action.edit
- content.tooltips
- content.code.annotate
- navigation.tabs
palette:
# Palette for light mode
- scheme: default
@@ -94,15 +114,22 @@ theme:
toggle:
icon: material/brightness-4
name: Switch to light mode
font:
text: Roboto
code: Roboto Mono
features:
- content.code.copy
- content.code.annotate
features:
- content.code.copy
- content.code.annotate
plugins:
- search
- mkdocs-jupyter:
kernel_name: python3
execute: false
include_source: True
include_requirejs: true
- mkdocstrings:
default_handler: python
handlers:
@@ -118,9 +145,15 @@ plugins:
show_symbol_type_heading: true
show_symbol_type_toc: true
show_category_heading: true
import:
- https://docs.python-requests.org/en/master/objects.inv
domains: [std, py]
- git-committers:
repository: roboflow/supervision
branch: develop
token: !ENV ["GITHUB_TOKEN"]
- git-revision-date-localized:
enable_creation_date: true
markdown_extensions:
- admonition
@@ -137,7 +170,11 @@ markdown_extensions:
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.snippets:
check_paths: true
- pymdownx.highlight:
anchor_linenums: true
extra_javascript:
- "https://widget.kapa.ai/kapa-widget.bundle.js"
- "javascript/init_kapa_widget.js"
- "javascripts/init_kapa_widget.js"
- "javascripts/cookbooks-card.js"
- "https://cdnjs.cloudflare.com/ajax/libs/dompurify/3.0.8/purify.min.js"
Generated
+909 -638
View File
File diff suppressed because it is too large Load Diff
+30 -28
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "supervision"
version = "0.19.0rc2"
version = "0.21.0"
description = "A set of easy-to-use utils that will come in handy in any Computer Vision project"
authors = ["Piotr Skalski <piotr.skalski92@gmail.com>"]
maintainers = ["Piotr Skalski <piotr.skalski92@gmail.com>"]
@@ -39,35 +39,42 @@ scipy = [
]
matplotlib = ">=3.6.0"
pyyaml = ">=5.3"
defusedxml = "^0.7.1"
opencv-python = { version = ">=4.5.5.64", optional = true }
opencv-python-headless = ">=4.5.5.64"
requests = { version = ">=2.26.0,<=2.31.0", optional = true }
tqdm = { version = ">=4.62.3,<=4.66.1", optional = true }
defusedxml = "^0.7.1"
requests = { version = ">=2.26.0,<=2.32.3", optional = true }
tqdm = { version = ">=4.62.3,<=4.66.4", optional = true }
pillow = ">=9.4"
[tool.poetry.extras]
desktop = ["opencv-python"]
assets = ["requests","tqdm"]
[tool.poetry.group.dev.dependencies]
twine = "^4.0.2"
twine = ">=4.0.2,<6.0.0"
pytest = ">=7.2.2,<9.0.0"
wheel = ">=0.40,<0.43"
notebook = ">=6.5.3,<8.0.0"
build = ">=0.10,<1.1"
wheel = ">=0.40,<0.44"
build = ">=0.10,<1.3"
ruff = ">=0.1.0"
isort = "^5.12.0"
mypy = "^1.4.1"
pre-commit = "^3.3.3"
tox = "^4.11.4"
notebook = ">=6.5.3,<8.0.0"
ipywidgets = "^8.1.1"
jupytext = "^1.16.1"
nbconvert = "^7.14.2"
[tool.poetry.group.docs.dependencies]
mkdocs-material = {extras = ["imaging"], version = "^9.5.5"}
mkdocstrings = {extras = ["python"], version = ">=0.20,<0.25"}
mkdocstrings = {extras = ["python"], version = ">=0.20,<0.26"}
mike = "^2.0.0"
# For Documentation Development use Python 3.10 or above
# Use Latest mkdocs-jupyter min 0.24.6 for Jupyter Notebook Theme support
mkdocs-jupyter = "^0.24.3"
mkdocs-git-committers-plugin-2 = "^2.2.3"
mkdocs-git-revision-date-localized-plugin = "^1.2.4"
[tool.isort]
@@ -104,13 +111,6 @@ exclude = '''
[tool.ruff]
target-version = "py38"
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F"]
ignore = []
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
@@ -140,33 +140,35 @@ exclude = [
"docs",
]
# Same as Black.
line-length = 88
indent-width = 4
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F"]
ignore = []
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
pylint.max-args = 20
[tool.ruff.flake8-quotes]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"
multiline-quotes = "double"
docstring-quotes = "double"
[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402","F401"]
"supervision/assets/list.py" = ["E501"]
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 5.
max-complexity = 20
[tool.ruff.pylint]
max-args = 20
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
+36 -5
View File
@@ -12,6 +12,7 @@ from supervision.annotators.core import (
BoxCornerAnnotator,
CircleAnnotator,
ColorAnnotator,
CropAnnotator,
DotAnnotator,
EllipseAnnotator,
HaloAnnotator,
@@ -22,6 +23,7 @@ from supervision.annotators.core import (
PercentageBarAnnotator,
PixelateAnnotator,
PolygonAnnotator,
RichLabelAnnotator,
RoundBoxAnnotator,
TraceAnnotator,
TriangleAnnotator,
@@ -33,29 +35,43 @@ from supervision.dataset.core import (
ClassificationDataset,
DetectionDataset,
)
from supervision.dataset.utils import mask_to_rle, rle_to_mask
from supervision.detection.annotate import BoxAnnotator
from supervision.detection.core import Detections
from supervision.detection.line_counter import LineZone, LineZoneAnnotator
from supervision.detection.line_zone import LineZone, LineZoneAnnotator
from supervision.detection.lmm import LMM
from supervision.detection.overlap_filter import (
OverlapFilter,
box_non_max_merge,
box_non_max_suppression,
mask_non_max_suppression,
)
from supervision.detection.tools.csv_sink import CSVSink
from supervision.detection.tools.inference_slicer import InferenceSlicer
from supervision.detection.tools.json_sink import JSONSink
from supervision.detection.tools.polygon_zone import PolygonZone, PolygonZoneAnnotator
from supervision.detection.tools.smoother import DetectionsSmoother
from supervision.detection.utils import (
box_iou_batch,
calculate_masks_centroids,
clip_boxes,
contains_holes,
contains_multiple_segments,
filter_polygons_by_area,
mask_iou_batch,
mask_to_polygons,
mask_to_xyxy,
move_boxes,
non_max_suppression,
move_masks,
pad_boxes,
polygon_to_mask,
polygon_to_xyxy,
scale_boxes,
)
from supervision.draw.color import Color, ColorPalette
from supervision.draw.utils import (
calculate_dynamic_line_thickness,
calculate_dynamic_text_scale,
calculate_optimal_line_thickness,
calculate_optimal_text_scale,
draw_filled_rectangle,
draw_image,
draw_line,
@@ -65,10 +81,25 @@ from supervision.draw.utils import (
)
from supervision.geometry.core import Point, Position, Rect
from supervision.geometry.utils import get_polygon_center
from supervision.keypoint.annotators import (
EdgeAnnotator,
VertexAnnotator,
VertexLabelAnnotator,
)
from supervision.keypoint.core import KeyPoints
from supervision.metrics.detection import ConfusionMatrix, MeanAveragePrecision
from supervision.tracker.byte_tracker.core import ByteTrack
from supervision.utils.conversion import cv2_to_pillow, pillow_to_cv2
from supervision.utils.file import list_files_with_extensions
from supervision.utils.image import ImageSink, crop_image
from supervision.utils.image import (
ImageSink,
create_tiles,
crop_image,
letterbox_image,
overlay_image,
resize_image,
scale_image,
)
from supervision.utils.notebook import plot_image, plot_images_grid
from supervision.utils.video import (
FPSMonitor,
+12 -1
View File
@@ -1,11 +1,22 @@
from abc import ABC, abstractmethod
from typing import TypeVar
import numpy as np
from PIL import Image
from supervision.detection.core import Detections
ImageType = TypeVar("ImageType", np.ndarray, Image.Image)
"""
An image of type `np.ndarray` or `PIL.Image.Image`.
Unlike a `Union`, ensures the type remains consistent. If a function
takes an `ImageType` argument and returns an `ImageType`, when you
pass an `np.ndarray`, you will get an `np.ndarray` back.
"""
class BaseAnnotator(ABC):
@abstractmethod
def annotate(self, scene: np.ndarray, detections: Detections) -> np.ndarray:
def annotate(self, scene: ImageType, detections: Detections) -> ImageType:
pass
File diff suppressed because it is too large Load Diff
+58 -5
View File
@@ -1,5 +1,5 @@
from enum import Enum
from typing import Optional, Union
from typing import Optional, Tuple, Union
import numpy as np
@@ -34,14 +34,14 @@ def resolve_color_idx(
) -> int:
if detection_idx >= len(detections):
raise ValueError(
f"Detection index {detection_idx}"
f"Detection index {detection_idx} "
f"is out of bounds for detections of length {len(detections)}"
)
if isinstance(color_lookup, np.ndarray):
if len(color_lookup) != len(detections):
raise ValueError(
f"Length of color lookup {len(color_lookup)}"
f"Length of color lookup {len(color_lookup)} "
f"does not match length of detections {len(detections)}"
)
return color_lookup[detection_idx]
@@ -50,19 +50,72 @@ def resolve_color_idx(
elif color_lookup == ColorLookup.CLASS:
if detections.class_id is None:
raise ValueError(
"Could not resolve color by class because"
"Could not resolve color by class because "
"Detections do not have class_id"
)
return detections.class_id[detection_idx]
elif color_lookup == ColorLookup.TRACK:
if detections.tracker_id is None:
raise ValueError(
"Could not resolve color by track because"
"Could not resolve color by track because "
"Detections do not have tracker_id"
)
return detections.tracker_id[detection_idx]
def resolve_text_background_xyxy(
center_coordinates: Tuple[int, int],
text_wh: Tuple[int, int],
position: Position,
) -> Tuple[int, int, int, int]:
center_x, center_y = center_coordinates
text_w, text_h = text_wh
if position == Position.TOP_LEFT:
return center_x, center_y - text_h, center_x + text_w, center_y
elif position == Position.TOP_RIGHT:
return center_x - text_w, center_y - text_h, center_x, center_y
elif position == Position.TOP_CENTER:
return (
center_x - text_w // 2,
center_y - text_h,
center_x + text_w // 2,
center_y,
)
elif position == Position.CENTER or position == Position.CENTER_OF_MASS:
return (
center_x - text_w // 2,
center_y - text_h // 2,
center_x + text_w // 2,
center_y + text_h // 2,
)
elif position == Position.BOTTOM_LEFT:
return center_x, center_y, center_x + text_w, center_y + text_h
elif position == Position.BOTTOM_RIGHT:
return center_x - text_w, center_y, center_x, center_y + text_h
elif position == Position.BOTTOM_CENTER:
return (
center_x - text_w // 2,
center_y,
center_x + text_w // 2,
center_y + text_h,
)
elif position == Position.CENTER_LEFT:
return (
center_x - text_w,
center_y - text_h // 2,
center_x,
center_y + text_h // 2,
)
elif position == Position.CENTER_RIGHT:
return (
center_x,
center_y - text_h // 2,
center_x + text_w,
center_y + text_h // 2,
)
def get_color_by_index(color: Union[Color, ColorPalette], idx: int) -> Color:
if isinstance(color, ColorPalette):
return color.by_idx(idx)
+12
View File
@@ -18,6 +18,8 @@ class VideoAssets(Enum):
| `SUBWAY` | `subway.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/subway.mp4) |
| `MARKET_SQUARE` | `market-square.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/market-square.mp4) |
| `PEOPLE_WALKING` | `people-walking.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/people-walking.mp4) |
| `BEACH` | `beach-1.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/beach-1.mp4) |
| `BASKETBALL` | `basketball-1.mp4` | [Link](https://media.roboflow.com/supervision/video-examples/basketball-1.mp4) |
""" # noqa: E501 // docs
VEHICLES = "vehicles.mp4"
@@ -27,6 +29,8 @@ class VideoAssets(Enum):
SUBWAY = "subway.mp4"
MARKET_SQUARE = "market-square.mp4"
PEOPLE_WALKING = "people-walking.mp4"
BEACH = "beach-1.mp4"
BASKETBALL = "basketball-1.mp4"
@classmethod
def list(cls):
@@ -62,4 +66,12 @@ VIDEO_ASSETS: Dict[str, Tuple[str, str]] = {
f"{BASE_VIDEO_URL}{VideoAssets.PEOPLE_WALKING.value}",
"0574c053c8686c3f1dc0aa3743e45cb9",
),
VideoAssets.BEACH.value: (
f"{BASE_VIDEO_URL}{VideoAssets.BEACH.value}",
"4175d42fec4d450ed081523fd39e0cf8",
),
VideoAssets.BASKETBALL.value: (
f"{BASE_VIDEO_URL}{VideoAssets.BASKETBALL.value}",
"60d94a3c7c47d16f09d342b088012ecc",
),
}
+23 -11
View File
@@ -116,13 +116,12 @@ class DetectionDataset(BaseDataset):
Tuple[DetectionDataset, DetectionDataset]: A tuple containing
the training and testing datasets.
Example:
Examples:
```python
import supervision as sv
ds = sv.DetectionDataset(...)
train_ds, test_ds = ds.split(split_ratio=0.7,
random_state=42, shuffle=True)
train_ds, test_ds = ds.split(split_ratio=0.7, random_state=42, shuffle=True)
len(train_ds), len(test_ds)
# (700, 300)
```
@@ -229,7 +228,7 @@ class DetectionDataset(BaseDataset):
DetectionDataset: A DetectionDataset instance containing
the loaded images and annotations.
Example:
Examples:
```python
import roboflow
from roboflow import Roboflow
@@ -286,7 +285,7 @@ class DetectionDataset(BaseDataset):
DetectionDataset: A DetectionDataset instance
containing the loaded images and annotations.
Example:
Examples:
```python
import roboflow
from roboflow import Roboflow
@@ -391,7 +390,7 @@ class DetectionDataset(BaseDataset):
DetectionDataset: A DetectionDataset instance containing
the loaded images and annotations.
Example:
Examples:
```python
import roboflow
from roboflow import Roboflow
@@ -431,6 +430,20 @@ class DetectionDataset(BaseDataset):
Exports the dataset to COCO format. This method saves the
images and their corresponding annotations in COCO format.
!!! tip
The format of the mask is determined automatically based on its structure:
- If a mask contains multiple disconnected components or holes, it will be
saved using the Run-Length Encoding (RLE) format for efficient storage and
processing.
- If a mask consists of a single, contiguous region without any holes, it
will be encoded as a polygon, preserving the outline of the object.
This automatic selection ensures that the masks are stored in the most
appropriate and space-efficient format, complying with COCO dataset
standards.
Args:
images_directory_path (Optional[str]): The path to the directory
where the images should be saved.
@@ -482,7 +495,7 @@ class DetectionDataset(BaseDataset):
(DetectionDataset): A single `DetectionDataset` object containing
the merged data from the input list.
Example:
Examples:
```python
import supervision as sv
@@ -567,13 +580,12 @@ class ClassificationDataset(BaseDataset):
Tuple[ClassificationDataset, ClassificationDataset]: A tuple containing
the training and testing datasets.
Example:
Examples:
```python
import supervision as sv
cd = sv.ClassificationDataset(...)
train_cd,test_cd = cd.split(split_ratio=0.7,
random_state=42,shuffle=True)
train_cd,test_cd = cd.split(split_ratio=0.7, random_state=42,shuffle=True)
len(train_cd), len(test_cd)
# (700, 300)
```
@@ -635,7 +647,7 @@ class ClassificationDataset(BaseDataset):
Returns:
ClassificationDataset: The dataset.
Example:
Examples:
```python
import roboflow
from roboflow import Roboflow
+49 -24
View File
@@ -5,13 +5,20 @@ from typing import Dict, List, Tuple
import cv2
import numpy as np
import numpy.typing as npt
from supervision.dataset.utils import (
approximate_mask_with_polygons,
map_detections_class_id,
mask_to_rle,
rle_to_mask,
)
from supervision.detection.core import Detections
from supervision.detection.utils import polygon_to_mask
from supervision.detection.utils import (
contains_holes,
contains_multiple_segments,
polygon_to_mask,
)
from supervision.utils.file import read_json_file, save_json_file
@@ -57,13 +64,24 @@ def group_coco_annotations_by_image_id(
return annotations
def _polygons_to_masks(
polygons: List[np.ndarray], resolution_wh: Tuple[int, int]
) -> np.ndarray:
def coco_annotations_to_masks(
image_annotations: List[dict], resolution_wh: Tuple[int, int]
) -> npt.NDArray[np.bool_]:
return np.array(
[
polygon_to_mask(polygon=polygon, resolution_wh=resolution_wh)
for polygon in polygons
rle_to_mask(
rle=np.array(image_annotation["segmentation"]["counts"]),
resolution_wh=resolution_wh,
)
if image_annotation["iscrowd"]
else polygon_to_mask(
polygon=np.reshape(
np.asarray(image_annotation["segmentation"], dtype=np.int32),
(-1, 2),
),
resolution_wh=resolution_wh,
)
for image_annotation in image_annotations
],
dtype=bool,
)
@@ -83,13 +101,9 @@ def coco_annotations_to_detections(
xyxy[:, 2:4] += xyxy[:, 0:2]
if with_masks:
polygons = [
np.reshape(
np.asarray(image_annotation["segmentation"], dtype=np.int32), (-1, 2)
)
for image_annotation in image_annotations
]
mask = _polygons_to_masks(polygons=polygons, resolution_wh=resolution_wh)
mask = coco_annotations_to_masks(
image_annotations=image_annotations, resolution_wh=resolution_wh
)
return Detections(
class_id=np.asarray(class_ids, dtype=int), xyxy=xyxy, mask=mask
)
@@ -108,24 +122,35 @@ def detections_to_coco_annotations(
coco_annotations = []
for xyxy, mask, _, class_id, _, _ in detections:
box_width, box_height = xyxy[2] - xyxy[0], xyxy[3] - xyxy[1]
polygon = []
segmentation = []
iscrowd = 0
if mask is not None:
polygon = list(
approximate_mask_with_polygons(
mask=mask,
min_image_area_percentage=min_image_area_percentage,
max_image_area_percentage=max_image_area_percentage,
approximation_percentage=approximation_percentage,
)[0].flatten()
)
iscrowd = contains_holes(mask=mask) or contains_multiple_segments(mask=mask)
if iscrowd:
segmentation = {
"counts": mask_to_rle(mask=mask),
"size": list(mask.shape[:2]),
}
else:
segmentation = [
list(
approximate_mask_with_polygons(
mask=mask,
min_image_area_percentage=min_image_area_percentage,
max_image_area_percentage=max_image_area_percentage,
approximation_percentage=approximation_percentage,
)[0].flatten()
)
]
coco_annotation = {
"id": annotation_id,
"image_id": image_id,
"category_id": int(class_id),
"bbox": [xyxy[0], xyxy[1], box_width, box_height],
"area": box_width * box_height,
"segmentation": [polygon] if polygon else [],
"iscrowd": 0,
"segmentation": segmentation,
"iscrowd": iscrowd,
}
coco_annotations.append(coco_annotation)
annotation_id += 1
+122 -1
View File
@@ -2,10 +2,11 @@ import copy
import os
import random
from pathlib import Path
from typing import Dict, List, Optional, Tuple, TypeVar
from typing import Dict, List, Optional, Tuple, TypeVar, Union
import cv2
import numpy as np
import numpy.typing as npt
from supervision.detection.core import Detections
from supervision.detection.utils import (
@@ -129,3 +130,123 @@ def train_test_split(
split_index = int(len(data) * train_ratio)
return data[:split_index], data[split_index:]
def rle_to_mask(
rle: Union[npt.NDArray[np.int_], List[int]], resolution_wh: Tuple[int, int]
) -> npt.NDArray[np.bool_]:
"""
Converts run-length encoding (RLE) to a binary mask.
Args:
rle (Union[npt.NDArray[np.int_], List[int]]): The 1D RLE array, the format
used in the COCO dataset (column-wise encoding, values of an array with
even indices represent the number of pixels assigned as background,
values of an array with odd indices represent the number of pixels
assigned as foreground object).
resolution_wh (Tuple[int, int]): The width (w) and height (h)
of the desired binary mask.
Returns:
The generated 2D Boolean mask of shape `(h, w)`, where the foreground object is
marked with `True`'s and the rest is filled with `False`'s.
Raises:
AssertionError: If the sum of pixels encoded in RLE differs from the
number of pixels in the expected mask (computed based on resolution_wh).
Examples:
```python
import supervision as sv
sv.rle_to_mask([5, 2, 2, 2, 5], (4, 4))
# array([
# [False, False, False, False],
# [False, True, True, False],
# [False, True, True, False],
# [False, False, False, False],
# ])
```
"""
if isinstance(rle, list):
rle = np.array(rle, dtype=int)
width, height = resolution_wh
assert width * height == np.sum(rle), (
"the sum of the number of pixels in the RLE must be the same "
"as the number of pixels in the expected mask"
)
zero_one_values = np.zeros(shape=(rle.size, 1), dtype=np.uint8)
zero_one_values[1::2] = 1
decoded_rle = np.repeat(zero_one_values, rle, axis=0)
decoded_rle = np.append(
decoded_rle, np.zeros(width * height - len(decoded_rle), dtype=np.uint8)
)
return decoded_rle.reshape((height, width), order="F")
def mask_to_rle(mask: npt.NDArray[np.bool_]) -> List[int]:
"""
Converts a binary mask into a run-length encoding (RLE).
Args:
mask (npt.NDArray[np.bool_]): 2D binary mask where `True` indicates foreground
object and `False` indicates background.
Returns:
The run-length encoded mask. Values of a list with even indices
represent the number of pixels assigned as background (`False`), values
of a list with odd indices represent the number of pixels assigned
as foreground object (`True`).
Raises:
AssertionError: If input mask is not 2D or is empty.
Examples:
```python
import numpy as np
import supervision as sv
mask = np.array([
[True, True, True, True],
[True, True, True, True],
[True, True, True, True],
[True, True, True, True],
])
sv.mask_to_rle(mask)
# [0, 16]
mask = np.array([
[False, False, False, False],
[False, True, True, False],
[False, True, True, False],
[False, False, False, False],
])
sv.mask_to_rle(mask)
# [5, 2, 2, 2, 5]
```
![mask_to_rle](https://media.roboflow.com/supervision-docs/mask-to-rle.png){ align=center width="800" }
""" # noqa E501 // docs
assert mask.ndim == 2, "Input mask must be 2D"
assert mask.size != 0, "Input mask cannot be empty"
on_value_change_indices = np.where(
mask.ravel(order="F") != np.roll(mask.ravel(order="F"), 1)
)[0]
on_value_change_indices = np.append(on_value_change_indices, mask.size)
# need to add 0 at the beginning when the same value is in the first and
# last element of the flattened mask
if on_value_change_indices[0] != 0:
on_value_change_indices = np.insert(on_value_change_indices, 0, 0)
rle = np.diff(on_value_change_indices)
if mask[0][0] == 1:
rle = np.insert(rle, 0, 0)
return list(rle)
+14 -9
View File
@@ -1,17 +1,14 @@
from typing import List, Optional, Union
import cv2
import numpy as np
from supervision.annotators.base import ImageType
from supervision.detection.core import Detections
from supervision.draw.color import Color, ColorPalette
from supervision.utils.conversion import convert_for_annotation_method
from supervision.utils.internal import deprecated
@deprecated(
"`BoxAnnotator` is deprecated and will be removed in "
"`supervision-0.22.0`. Use `BoundingBoxAnnotator` and `LabelAnnotator` instead"
)
class BoxAnnotator:
"""
A class for drawing bounding boxes on an image using detections provided.
@@ -45,18 +42,25 @@ class BoxAnnotator:
self.text_thickness: int = text_thickness
self.text_padding: int = text_padding
@deprecated(
"`BoxAnnotator` is deprecated and will be removed in "
"`supervision-0.22.0`. Use `BoundingBoxAnnotator` and `LabelAnnotator` instead"
)
@convert_for_annotation_method
def annotate(
self,
scene: np.ndarray,
scene: ImageType,
detections: Detections,
labels: Optional[List[str]] = None,
skip_label: bool = False,
) -> np.ndarray:
) -> ImageType:
"""
Draws bounding boxes on the frame using the detections provided.
Args:
scene (np.ndarray): The image on which the bounding boxes will be drawn
scene (ImageType): The image on which the bounding boxes will be drawn.
`ImageType` is a flexible type, accepting either `numpy.ndarray`
or `PIL.Image.Image`.
detections (Detections): The detections for which the
bounding boxes will be drawn
labels (Optional[List[str]]): An optional list of labels
@@ -64,7 +68,8 @@ class BoxAnnotator:
corresponding `class_id` will be used as label.
skip_label (bool): Is set to `True`, skips bounding box label annotation.
Returns:
np.ndarray: The image with the bounding boxes drawn on it
ImageType: The image with the bounding boxes drawn on it, matching the
type of `scene` (`numpy.ndarray` or `PIL.Image.Image`)
Example:
```python

Some files were not shown because too many files have changed in this diff Show More