Update example images and modify code parameters
This commit is contained in:
+35
-10
@@ -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
|
||||
|
||||
@@ -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:
|
||||
@@ -281,7 +281,7 @@ class HaloAnnotator(BaseAnnotator):
|
||||
```
|
||||
|
||||

|
||||
supervision-annotator-examples/halo-annotator-example-purple.png)
|
||||
"""
|
||||
if detections.mask is None:
|
||||
return scene
|
||||
@@ -366,7 +366,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 +402,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 +445,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 +525,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 +665,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 +760,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 +836,7 @@ class TraceAnnotator:
|
||||
```
|
||||
|
||||

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