From 81ee4f1c2cd74cfcc8c856180db972374729c8c1 Mon Sep 17 00:00:00 2001 From: LinasKo Date: Thu, 19 Sep 2024 22:37:36 +0300 Subject: [PATCH] Add draw_filled_polygon to docs, fix a few docstring types --- docs/utils/draw.md | 6 ++++++ supervision/draw/utils.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/utils/draw.md b/docs/utils/draw.md index f4b86a53..d881051f 100644 --- a/docs/utils/draw.md +++ b/docs/utils/draw.md @@ -28,6 +28,12 @@ comments: true :::supervision.draw.utils.draw_polygon +
+

draw_filled_polygon

+
+ +:::supervision.draw.utils.draw_filled_polygon +

draw_text

diff --git a/supervision/draw/utils.py b/supervision/draw/utils.py index b5df0921..19ce4a25 100644 --- a/supervision/draw/utils.py +++ b/supervision/draw/utils.py @@ -173,13 +173,13 @@ def draw_polygon( def draw_filled_polygon( scene: np.ndarray, polygon: np.ndarray, color: Color, opacity: float = 1 ) -> np.ndarray: - """Draw a polygon on a scene. + """Draw a filled polygon on a scene. Parameters: scene (np.ndarray): The scene to draw the polygon on. polygon (np.ndarray): The polygon to be drawn, given as a list of vertices. color (Color): The color of the polygon. - opacity (float): The opacity of rectangle when drawn on the scene. + opacity (float): The opacity of polygon when drawn on the scene. Returns: np.ndarray: The scene with the polygon drawn on it.