2024-04-24 15:39:08 +02:00
|
|
|
---
|
|
|
|
|
comments: true
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Annotators
|
|
|
|
|
|
2024-04-24 16:18:21 +02:00
|
|
|
=== "VertexAnnotator"
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
import supervision as sv
|
|
|
|
|
|
|
|
|
|
image = ...
|
|
|
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
|
|
2024-05-13 14:30:55 +02:00
|
|
|
vertex_annotator = sv.VertexAnnotator(
|
2024-05-13 12:31:34 +00:00
|
|
|
color=sv.Color.GREEN,
|
2026-02-03 22:00:40 +09:00
|
|
|
radius=10,
|
2024-05-13 14:30:55 +02:00
|
|
|
)
|
2024-04-24 16:18:21 +02:00
|
|
|
annotated_frame = vertex_annotator.annotate(
|
|
|
|
|
scene=image.copy(),
|
2026-02-03 22:00:40 +09:00
|
|
|
key_points=key_points,
|
2024-04-24 16:18:21 +02:00
|
|
|
)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<div class="result" markdown>
|
|
|
|
|
|
|
|
|
|
{ align=center width="800" }
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
=== "EdgeAnnotator"
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
import supervision as sv
|
|
|
|
|
|
|
|
|
|
image = ...
|
|
|
|
|
key_points = sv.KeyPoints(...)
|
|
|
|
|
|
2024-05-13 14:30:55 +02:00
|
|
|
edge_annotator = sv.EdgeAnnotator(
|
2024-05-13 12:31:34 +00:00
|
|
|
color=sv.Color.GREEN,
|
2026-02-03 22:00:40 +09:00
|
|
|
thickness=5,
|
2024-05-13 14:30:55 +02:00
|
|
|
)
|
2024-04-24 16:18:21 +02:00
|
|
|
annotated_frame = edge_annotator.annotate(
|
|
|
|
|
scene=image.copy(),
|
2026-02-03 22:00:40 +09:00
|
|
|
key_points=key_points,
|
2024-04-24 16:18:21 +02:00
|
|
|
)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<div class="result" markdown>
|
|
|
|
|
|
|
|
|
|
{ align=center width="800" }
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-05-13 14:30:55 +02:00
|
|
|
=== "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,
|
2026-02-03 22:00:40 +09:00
|
|
|
border_radius=5,
|
2024-05-13 14:30:55 +02:00
|
|
|
)
|
|
|
|
|
annotated_frame = vertex_label_annotator.annotate(
|
|
|
|
|
scene=image.copy(),
|
2026-02-03 22:00:40 +09:00
|
|
|
key_points=key_points,
|
2024-05-13 14:30:55 +02:00
|
|
|
)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
<div class="result" markdown>
|
|
|
|
|
|
|
|
|
|
{ align=center width="800" }
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-04-24 16:18:21 +02:00
|
|
|
<div class="md-typeset">
|
2025-07-28 08:24:43 +02:00
|
|
|
<h2><a href="#supervision.key_points.annotators.VertexAnnotator">VertexAnnotator</a></h2>
|
2024-04-24 16:18:21 +02:00
|
|
|
</div>
|
|
|
|
|
|
2025-07-28 08:24:43 +02:00
|
|
|
:::supervision.key_points.annotators.VertexAnnotator
|
2024-04-24 15:39:08 +02:00
|
|
|
|
2024-04-24 16:18:21 +02:00
|
|
|
<div class="md-typeset">
|
2025-07-28 08:24:43 +02:00
|
|
|
<h2><a href="#supervision.key_points.annotators.EdgeAnnotator">EdgeAnnotator</a></h2>
|
2024-04-24 16:18:21 +02:00
|
|
|
</div>
|
|
|
|
|
|
2025-07-28 08:24:43 +02:00
|
|
|
:::supervision.key_points.annotators.EdgeAnnotator
|
2024-05-13 14:30:55 +02:00
|
|
|
|
|
|
|
|
<div class="md-typeset">
|
2025-07-28 08:24:43 +02:00
|
|
|
<h2><a href="#supervision.key_points.annotators.VertexLabelAnnotator">VertexLabelAnnotator</a></h2>
|
2024-05-13 14:30:55 +02:00
|
|
|
</div>
|
|
|
|
|
|
2025-07-28 08:24:43 +02:00
|
|
|
:::supervision.key_points.annotators.VertexLabelAnnotator
|