Skip to content

Commit

Permalink
Add docstring
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
  • Loading branch information
ashwinvaidya17 committed Jan 8, 2025
1 parent bd58096 commit b7592c2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion model_api/python/model_api/visualizer/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,20 @@ def compute(self, image: Image) -> Image:


class BoundingBox(Primitive):
"""Bounding box primitive."""
"""Bounding box primitive.
Args:
x1 (int): x-coordinate of the top-left corner of the bounding box.
y1 (int): y-coordinate of the top-left corner of the bounding box.
x2 (int): x-coordinate of the bottom-right corner of the bounding box.
y2 (int): y-coordinate of the bottom-right corner of the bounding box.
label (str | None): Label of the bounding box.
color (str | tuple[int, int, int]): Color of the bounding box.
Example:
>>> bounding_box = BoundingBox(x1=10, y1=10, x2=100, y2=100, label="Label Name")
>>> bounding_box.compute(image)
"""

def __init__(
self,
Expand Down

0 comments on commit b7592c2

Please sign in to comment.