Annotators¶
Bases: BaseKeyPointAnnotator
A class that specializes in drawing skeleton vertices on images. It uses specified key points to determine the locations where the vertices should be drawn.
Source code in supervision/keypoint/annotators.py
Functions¶
__init__(color=Color.ROBOFLOW, radius=4)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color |
Color
|
The color to use for annotating key points. |
ROBOFLOW
|
radius |
int
|
The radius of the circles used to represent the key points. |
4
|
Source code in supervision/keypoint/annotators.py
annotate(scene, key_points)
¶
Annotates the given scene with skeleton vertices based on the provided key points. It draws circles at each key point location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scene |
ImageType
|
The image where bounding boxes will be drawn. |
required |
key_points |
KeyPoints
|
A collection of key points where each key point consists of x and y coordinates. |
required |
Returns:
Type | Description |
---|---|
ImageType
|
The annotated image, matching the type of |
Example
Source code in supervision/keypoint/annotators.py
Bases: BaseKeyPointAnnotator
A class that specializes in drawing skeleton edges on images using specified key points. It connects key points with lines to form the skeleton structure.
Source code in supervision/keypoint/annotators.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
Functions¶
__init__(color=Color.ROBOFLOW, thickness=2, edges=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
color |
Color
|
The color to use for the edges. |
ROBOFLOW
|
thickness |
int
|
The thickness of the edges. |
2
|
edges |
Optional[List[Tuple[int, int]]]
|
The edges to draw.
If set to |
None
|
Source code in supervision/keypoint/annotators.py
annotate(scene, key_points)
¶
Annotates the given scene by drawing lines between specified key points to form edges.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scene |
ImageType
|
The image where bounding boxes will be drawn. |
required |
key_points |
KeyPoints
|
A collection of key points where each key point consists of x and y coordinates. |
required |
Returns:
Name | Type | Description |
---|---|---|
Returns |
ImageType
|
The annotated image, matching the type of |