- Added `KeyPoints.visible` mask support for per-keypoint visibility - Split confidence into `keypoint_confidence` and `detection_confidence` - Kept legacy `KeyPoints.confidence` as deprecated forwarding alias - Updated `KeyPoints` slicing/filtering to preserve visibility and confidence fields - Fixed `KeyPoints.__getitem__` row-index normalization for NumPy scalar, 0-D array, and boolean indexing - Fixed `detection_confidence` indexing to use normalized row indices - Updated `VertexAnnotator` to skip invisible keypoints - Updated `EdgeAnnotator` to skip invisible keypoints and edges - Added per-class skeleton support to `EdgeAnnotator` - Added multi-skeleton support to `VertexLabelAnnotator` - Added label validation for `VertexLabelAnnotator` - Added color-list length validation for keypoint annotators - Added `VertexEllipseAreaAnnotator` - Added `VertexEllipseOutlineAnnotator` - Added `VertexEllipseHaloAnnotator` - Kept/exported `VertexEllipseAnnotator` alongside the new ellipse variants - Standardized keypoint annotator docstrings and executable examples - Added/updated `validate_detection_confidence` and `validate_visible` - Removed/cleaned old keypoint validator shims - Added regression tests for visibility, confidence fields, multi-skeleton behavior, and indexing edge cases - Updated helpers and RF-DETR/keypoint tests for the new confidence/visibility model - Added API design principles to contributing docs - Ignored local multi-skeleton test script in `.gitignore` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com> Co-authored-by: OpenAI Codex <codex@openai.com>
170 lines
3.9 KiB
Markdown
170 lines
3.9 KiB
Markdown
---
|
|
comments: true
|
|
---
|
|
|
|
# Annotators
|
|
|
|
=== "VertexAnnotator"
|
|
|
|
```python
|
|
import supervision as sv
|
|
|
|
image = ...
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
vertex_annotator = sv.VertexAnnotator(
|
|
color=sv.Color.GREEN,
|
|
radius=10,
|
|
)
|
|
annotated_frame = vertex_annotator.annotate(
|
|
scene=image.copy(),
|
|
key_points=key_points,
|
|
)
|
|
```
|
|
|
|
<div class="result" markdown>
|
|
|
|
{ align=center width="800" }
|
|
|
|
</div>
|
|
|
|
=== "EdgeAnnotator"
|
|
|
|
```python
|
|
import supervision as sv
|
|
|
|
image = ...
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
edge_annotator = sv.EdgeAnnotator(
|
|
color=sv.Color.GREEN,
|
|
thickness=5,
|
|
)
|
|
annotated_frame = edge_annotator.annotate(
|
|
scene=image.copy(),
|
|
key_points=key_points,
|
|
)
|
|
```
|
|
|
|
<div class="result" markdown>
|
|
|
|
{ align=center width="800" }
|
|
|
|
</div>
|
|
|
|
=== "VertexLabelAnnotator"
|
|
|
|
```python
|
|
import supervision as sv
|
|
|
|
image = ...
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
vertex_label_annotator = sv.VertexLabelAnnotator(
|
|
color=sv.Color.GREEN,
|
|
text_color=sv.Color.BLACK,
|
|
border_radius=5,
|
|
)
|
|
annotated_frame = vertex_label_annotator.annotate(
|
|
scene=image.copy(),
|
|
key_points=key_points,
|
|
)
|
|
```
|
|
|
|
<div class="result" markdown>
|
|
|
|
{ align=center width="800" }
|
|
|
|
</div>
|
|
|
|
=== "VertexEllipseAreaAnnotator"
|
|
|
|
```python
|
|
import supervision as sv
|
|
|
|
image = ...
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
area_annotator = sv.VertexEllipseAreaAnnotator(
|
|
color=sv.Color.GREEN,
|
|
sigma=2.0,
|
|
)
|
|
annotated_frame = area_annotator.annotate(
|
|
scene=image.copy(),
|
|
key_points=key_points,
|
|
)
|
|
```
|
|
|
|
=== "VertexEllipseOutlineAnnotator"
|
|
|
|
```python
|
|
import supervision as sv
|
|
|
|
image = ...
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
outline_annotator = sv.VertexEllipseOutlineAnnotator(
|
|
color=sv.Color.GREEN,
|
|
sigma=2.0,
|
|
thickness=2,
|
|
)
|
|
annotated_frame = outline_annotator.annotate(
|
|
scene=image.copy(),
|
|
key_points=key_points,
|
|
)
|
|
```
|
|
|
|
=== "VertexEllipseHaloAnnotator"
|
|
|
|
```python
|
|
import supervision as sv
|
|
|
|
image = ...
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
halo_annotator = sv.VertexEllipseHaloAnnotator(
|
|
color=sv.Color.GREEN,
|
|
sigma=2.0,
|
|
)
|
|
annotated_frame = halo_annotator.annotate(
|
|
scene=image.copy(),
|
|
key_points=key_points,
|
|
)
|
|
```
|
|
|
|
<div class="md-typeset">
|
|
<h2><a href="#supervision.key_points.annotators.VertexAnnotator">VertexAnnotator</a></h2>
|
|
</div>
|
|
|
|
:::supervision.key_points.annotators.VertexAnnotator
|
|
|
|
<div class="md-typeset">
|
|
<h2><a href="#supervision.key_points.annotators.EdgeAnnotator">EdgeAnnotator</a></h2>
|
|
</div>
|
|
|
|
:::supervision.key_points.annotators.EdgeAnnotator
|
|
|
|
<div class="md-typeset">
|
|
<h2><a href="#supervision.key_points.annotators.VertexLabelAnnotator">VertexLabelAnnotator</a></h2>
|
|
</div>
|
|
|
|
:::supervision.key_points.annotators.VertexLabelAnnotator
|
|
|
|
<div class="md-typeset">
|
|
<h2><a href="#supervision.key_points.annotators.VertexEllipseAreaAnnotator">VertexEllipseAreaAnnotator</a></h2>
|
|
</div>
|
|
|
|
:::supervision.key_points.annotators.VertexEllipseAreaAnnotator
|
|
|
|
<div class="md-typeset">
|
|
<h2><a href="#supervision.key_points.annotators.VertexEllipseOutlineAnnotator">VertexEllipseOutlineAnnotator</a></h2>
|
|
</div>
|
|
|
|
:::supervision.key_points.annotators.VertexEllipseOutlineAnnotator
|
|
|
|
<div class="md-typeset">
|
|
<h2><a href="#supervision.key_points.annotators.VertexEllipseHaloAnnotator">VertexEllipseHaloAnnotator</a></h2>
|
|
</div>
|
|
|
|
:::supervision.key_points.annotators.VertexEllipseHaloAnnotator
|