diff --git a/docs/annotators.md b/docs/annotators.md index 7689845a..7dd8124d 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -166,6 +166,27 @@ +=== "Polygon" + + ```python + >>> import supervision as sv + + >>> image = ... + >>> detections = sv.Detections(...) + + >>> polygon_annotator = sv.PolygonAnnotator() + >>> annotated_frame = polygon_annotator.annotate( + ... scene=image.copy(), + ... detections=detections + ... ) + ``` + +
+ + ![polygon-annotator-example](https://media.roboflow.com/supervision-annotator-examples/polygon-annotator-example-purple.png){ align=center width="800" } + +
+ === "Label" ```python diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 2ee1f968..0e34cc16 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -233,6 +233,9 @@ class PolygonAnnotator(BaseAnnotator): ... detections=detections ... ) ``` + + ![polygon-annotator-example](https://media.roboflow.com/ + supervision-annotator-examples/polygon-annotator-example-purple.png) """ if detections.mask is None: return scene @@ -343,6 +346,10 @@ class BoxMaskAnnotator(BaseAnnotator): class HaloAnnotator(BaseAnnotator): """ A class for drawing Halos on an image using provided detections. + + !!! warning + + This annotator utilizes the `sv.Detections.mask`. """ def __init__(