From c46e0f5c976c7a13cc344559ba47dd6567193b7a Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 5 Dec 2023 10:38:32 +0000 Subject: [PATCH 1/5] rename BoxMaskAnnotator to ColorAnnotator --- docs/annotators.md | 6 +++--- supervision/__init__.py | 2 +- supervision/annotators/core.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/annotators.md b/docs/annotators.md index 7dd8124d6..ed10abb0c 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -48,7 +48,7 @@ >>> image = ... >>> detections = sv.Detections(...) - >>> box_mask_annotator = sv.BoxMaskAnnotator() + >>> box_mask_annotator = sv.ColorAnnotator() >>> annotated_frame = box_mask_annotator.annotate( ... scene=image.copy(), ... detections=detections @@ -297,9 +297,9 @@ :::supervision.annotators.core.BoxCornerAnnotator -## BoxMaskAnnotator +## ColorAnnotator -:::supervision.annotators.core.BoxMaskAnnotator +:::supervision.annotators.core.ColorAnnotator ## CircleAnnotator diff --git a/supervision/__init__.py b/supervision/__init__.py index 58a42e398..58589c06e 100644 --- a/supervision/__init__.py +++ b/supervision/__init__.py @@ -10,7 +10,7 @@ BlurAnnotator, BoundingBoxAnnotator, BoxCornerAnnotator, - BoxMaskAnnotator, + ColorAnnotator, CircleAnnotator, DotAnnotator, EllipseAnnotator, diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index ff19b3fe5..11e75219f 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -260,7 +260,7 @@ def annotate( return scene -class BoxMaskAnnotator(BaseAnnotator): +class ColorAnnotator(BaseAnnotator): """ A class for drawing box masks on an image using provided detections. """ @@ -308,7 +308,7 @@ def annotate( >>> image = ... >>> detections = sv.Detections(...) - >>> box_mask_annotator = sv.BoxMaskAnnotator() + >>> box_mask_annotator = sv.ColorAnnotator() >>> annotated_frame = box_mask_annotator.annotate( ... scene=image.copy(), ... detections=detections @@ -316,7 +316,7 @@ def annotate( ``` ![box-mask-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/box-mask-annotator-example-purple.png) + supervision-annotator-examples/color-annotator-example-purple.png) """ mask_image = scene.copy() for detection_idx in range(len(detections)): From 9d836faa8ac3960ab74e841322aad55c7c6f1a4f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:39:26 +0000 Subject: [PATCH 2/5] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20?= =?UTF-8?q?format=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/__init__.py b/supervision/__init__.py index 58589c06e..598866b83 100644 --- a/supervision/__init__.py +++ b/supervision/__init__.py @@ -10,8 +10,8 @@ BlurAnnotator, BoundingBoxAnnotator, BoxCornerAnnotator, - ColorAnnotator, CircleAnnotator, + ColorAnnotator, DotAnnotator, EllipseAnnotator, HaloAnnotator, From d53181bb97efd9f9a4ffdf4cbd144bcbaf2bdd27 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 5 Dec 2023 10:40:30 +0000 Subject: [PATCH 3/5] rename variable --- docs/annotators.md | 4 ++-- supervision/annotators/core.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/annotators.md b/docs/annotators.md index ed10abb0c..083a4ad13 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -48,8 +48,8 @@ >>> image = ... >>> detections = sv.Detections(...) - >>> box_mask_annotator = sv.ColorAnnotator() - >>> annotated_frame = box_mask_annotator.annotate( + >>> color_annotator = sv.ColorAnnotator() + >>> annotated_frame = color_annotator.annotate( ... scene=image.copy(), ... detections=detections ... ) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 11e75219f..7da5fbe32 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -308,8 +308,8 @@ def annotate( >>> image = ... >>> detections = sv.Detections(...) - >>> box_mask_annotator = sv.ColorAnnotator() - >>> annotated_frame = box_mask_annotator.annotate( + >>> color_annotator = sv.ColorAnnotator() + >>> annotated_frame = color_annotator.annotate( ... scene=image.copy(), ... detections=detections ... ) From 9c10308abc9ba564ab411f4758335f26f01ed365 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 5 Dec 2023 10:42:05 +0000 Subject: [PATCH 4/5] change heading --- docs/annotators.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/annotators.md b/docs/annotators.md index 083a4ad13..630239d2b 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -40,7 +40,7 @@ -=== "BoxMask" +=== "Color" ```python >>> import supervision as sv From 7f2b62a5cef7244798a18f877bf0e5edd6990f58 Mon Sep 17 00:00:00 2001 From: James Gallagher Date: Tue, 5 Dec 2023 10:42:31 +0000 Subject: [PATCH 5/5] show transparent image --- supervision/annotators/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 7da5fbe32..a0bf75b17 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -316,7 +316,7 @@ def annotate( ``` ![box-mask-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/color-annotator-example-purple.png) + supervision-annotator-examples/box-mask-annotator-example-purple.png) """ mask_image = scene.copy() for detection_idx in range(len(detections)):