Merge pull request #444 from roboflow/fix/halo-annotator-docs
Update example images and modify code parameters
This commit is contained in:
commit
33e43bc92a
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -36,11 +36,11 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
=== "BoxMaskAnnotator"
|
||||
=== "BoxMask"
|
||||
|
||||
```python
|
||||
>>> import supervision as sv
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -99,7 +99,28 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ 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>
|
||||
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -120,7 +141,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -141,7 +162,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -162,7 +183,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ align=center width="800" }
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -183,7 +204,7 @@
|
|||
|
||||
<div class="result" markdown>
|
||||
|
||||
{ align=center width="800" }
|
||||
{ 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 @@
|
|||
🚧 Page under construction.
|
||||
🚧 Page under construction.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
🚧 Page under construction.
|
||||
🚧 Page under construction.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
🚧 Page under construction.
|
||||
🚧 Page under construction.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
🚧 Page under construction.
|
||||
🚧 Page under construction.
|
||||
|
|
|
|||
|
|
@ -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>"]
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class BoundingBoxAnnotator(BaseAnnotator):
|
|||
```
|
||||
|
||||

|
||||
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):
|
|||
```
|
||||
|
||||

|
||||
supervision-annotator-examples/mask-annotator-example-purple.png)
|
||||
"""
|
||||
if detections.mask is None:
|
||||
return scene
|
||||
|
|
@ -205,7 +205,7 @@ class BoxMaskAnnotator(BaseAnnotator):
|
|||
```
|
||||
|
||||

|
||||
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):
|
|||
```
|
||||
|
||||

|
||||
supervision-annotator-examples/halo-annotator-example-purple.png)
|
||||
"""
|
||||
if detections.mask is None:
|
||||
return scene
|
||||
|
|
@ -366,7 +367,7 @@ class EllipseAnnotator(BaseAnnotator):
|
|||
```
|
||||
|
||||

|
||||
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):
|
|||
```
|
||||
|
||||

|
||||
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):
|
|||
|
||||
|
||||

|
||||
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:
|
|||
```
|
||||
|
||||

|
||||
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):
|
|||
```
|
||||
|
||||

|
||||
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:
|
|||
```
|
||||
|
||||

|
||||
supervision-annotator-examples/trace-annotator-example-purple.png)
|
||||
"""
|
||||
self.trace.put(detections)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue