diff --git a/README.md b/README.md index 7a384341..f9ac05b4 100644 --- a/README.md +++ b/README.md @@ -310,7 +310,7 @@ Visit our [documentation](https://roboflow.github.io/supervision) page to learn We love your input! Please see our [contributing guide](https://github.com/roboflow/supervision/blob/main/CONTRIBUTING.md) to get started. Thank you 🙏 to all our contributors! -

+

diff --git a/docs/annotators.md b/docs/annotators.md index 0626faad..9709d7c8 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -15,7 +15,7 @@

- ![bounding-box-annotator-example](https://media.roboflow.com/supervision-annotator-examples/bounding-box-annotator-example.png){ align=center width="800" } + ![bounding-box-annotator-example](https://media.roboflow.com/supervision-annotator-examples/bounding-box-annotator-example-purple.png){ align=center width="800" }
@@ -36,11 +36,11 @@
- ![box-corner-annotator-example](https://media.roboflow.com/supervision-annotator-examples/box-corner-annotator-example.png){ align=center width="800" } + ![box-corner-annotator-example](https://media.roboflow.com/supervision-annotator-examples/box-corner-annotator-example-purple.png){ align=center width="800" }
-=== "BoxMaskAnnotator" +=== "BoxMask" ```python >>> import supervision as sv @@ -57,7 +57,7 @@
- ![box-mask-annotator-example](https://media.roboflow.com/supervision-annotator-examples/box-mask-annotator-example.png){ align=center width="800" } + ![box-mask-annotator-example](https://media.roboflow.com/supervision-annotator-examples/box-mask-annotator-example-purple.png){ align=center width="800" }
@@ -78,7 +78,7 @@
- ![circle-annotator-example](https://media.roboflow.com/supervision-annotator-examples/circle-annotator-example.png){ align=center width="800" } + ![circle-annotator-example](https://media.roboflow.com/supervision-annotator-examples/circle-annotator-example-purple.png){ align=center width="800" }
@@ -99,7 +99,28 @@
- ![ellipse-annotator-example](https://media.roboflow.com/supervision-annotator-examples/ellipse-annotator-example.png){ align=center width="800" } + ![ellipse-annotator-example](https://media.roboflow.com/supervision-annotator-examples/ellipse-annotator-example-purple.png){ align=center width="800" } + +
+ +=== "Halo" + + ```python + >>> import supervision as sv + + >>> image = ... + >>> detections = sv.Detections(...) + + >>> halo_annotator = sv.HaloAnnotator() + >>> annotated_frame = halo_annotator.annotate( + ... scene=image.copy(), + ... detections=detections + ... ) + ``` + +
+ + ![ellipse-annotator-example](https://media.roboflow.com/supervision-annotator-examples/halo-annotator-example-purple.png){ align=center width="800" }
@@ -120,7 +141,7 @@
- ![mask-annotator-example](https://media.roboflow.com/supervision-annotator-examples/mask-annotator-example.png){ align=center width="800" } + ![mask-annotator-example](https://media.roboflow.com/supervision-annotator-examples/mask-annotator-example-purple.png){ align=center width="800" }
@@ -141,7 +162,7 @@
- ![label-annotator-example](https://media.roboflow.com/supervision-annotator-examples/label-annotator-example-2.png){ align=center width="800" } + ![label-annotator-example](https://media.roboflow.com/supervision-annotator-examples/label-annotator-example-purple.png){ align=center width="800" }
@@ -162,7 +183,7 @@
- ![blur-annotator-example](https://media.roboflow.com/supervision-annotator-examples/blur-annotator-example-2.png){ align=center width="800" } + ![blur-annotator-example](https://media.roboflow.com/supervision-annotator-examples/blur-annotator-example-purple.png){ align=center width="800" }
@@ -183,7 +204,7 @@
- ![trace-annotator-example](https://media.roboflow.com/supervision-annotator-examples/trace-annotator-example.png){ align=center width="800" } + ![trace-annotator-example](https://media.roboflow.com/supervision-annotator-examples/trace-annotator-example-purple.png){ align=center width="800" }
@@ -207,6 +228,10 @@ :::supervision.annotators.core.EllipseAnnotator +## HaloAnnotator + +:::supervision.annotators.core.HaloAnnotator + ## MaskAnnotator :::supervision.annotators.core.MaskAnnotator diff --git a/docs/how_to/detect_and_annotate.md b/docs/how_to/detect_and_annotate.md index 02a2f55b..c9497945 100644 --- a/docs/how_to/detect_and_annotate.md +++ b/docs/how_to/detect_and_annotate.md @@ -1 +1 @@ -🚧 Page under construction. \ No newline at end of file +🚧 Page under construction. diff --git a/docs/how_to/evaluate_model.md b/docs/how_to/evaluate_model.md index 02a2f55b..c9497945 100644 --- a/docs/how_to/evaluate_model.md +++ b/docs/how_to/evaluate_model.md @@ -1 +1 @@ -🚧 Page under construction. \ No newline at end of file +🚧 Page under construction. diff --git a/docs/how_to/process_video.md b/docs/how_to/process_video.md index 02a2f55b..c9497945 100644 --- a/docs/how_to/process_video.md +++ b/docs/how_to/process_video.md @@ -1 +1 @@ -🚧 Page under construction. \ No newline at end of file +🚧 Page under construction. diff --git a/docs/how_to/track_objects.md b/docs/how_to/track_objects.md index 02a2f55b..c9497945 100644 --- a/docs/how_to/track_objects.md +++ b/docs/how_to/track_objects.md @@ -1 +1 @@ -🚧 Page under construction. \ No newline at end of file +🚧 Page under construction. diff --git a/pyproject.toml b/pyproject.toml index a4e90a1a..8c68f03e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "supervision" -version = "0.15.0" +version = "0.16.0rc1" description = "A set of easy-to-use utils that will come in handy in any Computer Vision project" authors = ["Piotr Skalski "] maintainers = ["Piotr Skalski "] diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 494c94ad..895b8933 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -65,7 +65,7 @@ class BoundingBoxAnnotator(BaseAnnotator): ``` ![bounding-box-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/bounding-box-annotator-example.png) + supervision-annotator-examples/bounding-box-annotator-example-purple.png) """ for detection_idx in range(len(detections)): x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) @@ -134,7 +134,7 @@ class MaskAnnotator(BaseAnnotator): ``` ![mask-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/mask-annotator-example.png) + supervision-annotator-examples/mask-annotator-example-purple.png) """ if detections.mask is None: return scene @@ -205,7 +205,7 @@ class BoxMaskAnnotator(BaseAnnotator): ``` ![box-mask-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/box-mask-annotator-example.png) + supervision-annotator-examples/box-mask-annotator-example-purple.png) """ mask_image = scene.copy() for detection_idx in range(len(detections)): @@ -238,8 +238,8 @@ class HaloAnnotator(BaseAnnotator): self, color: Union[Color, ColorPalette] = ColorPalette.default(), opacity: float = 0.8, - color_map: str = "class", kernel_size: int = 40, + color_map: str = "class", ): """ Args: @@ -248,7 +248,8 @@ class HaloAnnotator(BaseAnnotator): opacity (float): Opacity of the overlay mask. Must be between `0` and `1`. color_map (str): Strategy for mapping colors to annotations. Options are `index`, `class`, or `track`. - kernel_size (int): The size of the average pooling kernel used for creating the halo. + kernel_size (int): The size of the average pooling kernel used for creating + the halo. """ self.color: Union[Color, ColorPalette] = color self.opacity = opacity @@ -281,7 +282,7 @@ class HaloAnnotator(BaseAnnotator): ``` ![halo-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/halo-annotator-example.png) + supervision-annotator-examples/halo-annotator-example-purple.png) """ if detections.mask is None: return scene @@ -366,7 +367,7 @@ class EllipseAnnotator(BaseAnnotator): ``` ![ellipse-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/ellipse-annotator-example.png) + supervision-annotator-examples/ellipse-annotator-example-purple.png) """ for detection_idx in range(len(detections)): x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) @@ -402,7 +403,7 @@ class BoxCornerAnnotator(BaseAnnotator): self, color: Union[Color, ColorPalette] = ColorPalette.default(), thickness: int = 4, - corner_length: int = 25, + corner_length: int = 15, color_map: str = "class", ): """ @@ -445,7 +446,7 @@ class BoxCornerAnnotator(BaseAnnotator): ``` ![box-corner-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/box-corner-annotator-example.png) + supervision-annotator-examples/box-corner-annotator-example-purple.png) """ for detection_idx in range(len(detections)): x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) @@ -525,7 +526,7 @@ class CircleAnnotator(BaseAnnotator): ![circle-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/circle-annotator-example.png) + supervision-annotator-examples/circle-annotator-example-purple.png) """ for detection_idx in range(len(detections)): x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) @@ -665,7 +666,7 @@ class LabelAnnotator: ``` ![label-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/label-annotator-example-2.png) + supervision-annotator-examples/label-annotator-example-purple.png) """ font = cv2.FONT_HERSHEY_SIMPLEX for detection_idx in range(len(detections)): @@ -760,7 +761,7 @@ class BlurAnnotator(BaseAnnotator): ``` ![blur-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/blur-annotator-example-2.png) + supervision-annotator-examples/blur-annotator-example-purple.png) """ for detection_idx in range(len(detections)): x1, y1, x2, y2 = detections.xyxy[detection_idx].astype(int) @@ -836,7 +837,7 @@ class TraceAnnotator: ``` ![trace-annotator-example](https://media.roboflow.com/ - supervision-annotator-examples/trace-annotator-example.png) + supervision-annotator-examples/trace-annotator-example-purple.png) """ self.trace.put(detections)