Merge pull request #444 from roboflow/fix/halo-annotator-docs

Update example images and modify code parameters
This commit is contained in:
Piotr Skalski
2023-10-09 16:24:26 +02:00
committed by GitHub
8 changed files with 55 additions and 29 deletions
+1 -1
View File
@@ -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!
<p align="center">
<p align="center">
<a href="https://github.com/roboflow/supervision/graphs/contributors">
<img src="https://contrib.rocks/image?repo=roboflow/supervision" />
</a>
+35 -10
View File
@@ -15,7 +15,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -36,11 +36,11 @@
<div class="result" markdown>
![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" }
</div>
=== "BoxMaskAnnotator"
=== "BoxMask"
```python
>>> import supervision as sv
@@ -57,7 +57,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -78,7 +78,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -99,7 +99,28 @@
<div class="result" markdown>
![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" }
</div>
=== "Halo"
```python
>>> import supervision as sv
>>> image = ...
>>> detections = sv.Detections(...)
>>> halo_annotator = sv.HaloAnnotator()
>>> annotated_frame = halo_annotator.annotate(
... scene=image.copy(),
... detections=detections
... )
```
<div class="result" markdown>
![ellipse-annotator-example](https://media.roboflow.com/supervision-annotator-examples/halo-annotator-example-purple.png){ align=center width="800" }
</div>
@@ -120,7 +141,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -141,7 +162,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -162,7 +183,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -183,7 +204,7 @@
<div class="result" markdown>
![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" }
</div>
@@ -207,6 +228,10 @@
:::supervision.annotators.core.EllipseAnnotator
## HaloAnnotator
:::supervision.annotators.core.HaloAnnotator
## MaskAnnotator
:::supervision.annotators.core.MaskAnnotator
+1 -1
View File
@@ -1 +1 @@
🚧 Page under construction.
🚧 Page under construction.
+1 -1
View File
@@ -1 +1 @@
🚧 Page under construction.
🚧 Page under construction.
+1 -1
View File
@@ -1 +1 @@
🚧 Page under construction.
🚧 Page under construction.
+1 -1
View File
@@ -1 +1 @@
🚧 Page under construction.
🚧 Page under construction.
+1 -1
View File
@@ -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 <piotr.skalski92@gmail.com>"]
maintainers = ["Piotr Skalski <piotr.skalski92@gmail.com>"]
+14 -13
View File
@@ -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)