diff --git a/docs/detection/annotate.md b/docs/detection/annotate.md new file mode 100644 index 00000000..fcebdec7 --- /dev/null +++ b/docs/detection/annotate.md @@ -0,0 +1,3 @@ +## BoxAnnotator + +:::supervision.detection.annotate.BoxAnnotator \ No newline at end of file diff --git a/docs/detection_core.md b/docs/detection/core.md similarity index 100% rename from docs/detection_core.md rename to docs/detection/core.md diff --git a/docs/detection_utils.md b/docs/detection/utils.md similarity index 100% rename from docs/detection_utils.md rename to docs/detection/utils.md diff --git a/mkdocs.yml b/mkdocs.yml index 9c267275..254e775b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,8 +26,9 @@ nav: - API reference: - Video: video.md - Detection: - - Core: detection_core.md - - Utils: detection_utils.md + - Core: detection/core.md + - Annotate: detection/annotate.md + - Utils: detection/utils.md - Draw: - Utils: draw_utils.md - Notebook: notebook.md diff --git a/supervision/detection/annotate.py b/supervision/detection/annotate.py index 29f0fba5..3c74653d 100644 --- a/supervision/detection/annotate.py +++ b/supervision/detection/annotate.py @@ -8,6 +8,19 @@ from supervision.draw.color import Color, ColorPalette class BoxAnnotator: + """ + A class for drawing bounding boxes on an image using detections provided. + + Attributes: + color (Union[Color, ColorPalette]): The color to draw the bounding box, can be a single color or a color palette + thickness (int): The thickness of the bounding box lines, default is 2 + text_color (Color): The color of the text on the bounding box, default is white + text_scale (float): The scale of the text on the bounding box, default is 0.5 + text_thickness (int): The thickness of the text on the bounding box, default is 1 + text_padding (int): The padding around the text on the bounding box, default is 5 + + """ + def __init__( self, color: Union[Color, ColorPalette] = ColorPalette.default(), @@ -17,18 +30,6 @@ class BoxAnnotator: text_thickness: int = 1, text_padding: int = 10, ): - """ - A class for drawing bounding boxes on an image using detections provided. - - Attributes: - color (Union[Color, ColorPalette]): The color to draw the bounding box, can be a single color or a color palette - thickness (int): The thickness of the bounding box lines, default is 2 - text_color (Color): The color of the text on the bounding box, default is white - text_scale (float): The scale of the text on the bounding box, default is 0.5 - text_thickness (int): The thickness of the text on the bounding box, default is 1 - text_padding (int): The padding around the text on the bounding box, default is 5 - - """ self.color: Union[Color, ColorPalette] = color self.thickness: int = thickness self.text_color: Color = text_color