File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## Position
2+
3+ :::supervision.geometry.core.Position
Original file line number Diff line number Diff line change @@ -644,15 +644,23 @@ def __all_not_none(item_list: List[Any]):
644644
645645 def get_anchor_coordinates (self , anchor : Position ) -> np .ndarray :
646646 """
647- Returns the bounding box coordinates for a specific anchor.
647+ Calculates and returns the coordinates of a specific anchor point
648+ within the bounding boxes defined by the `xyxy` attribute. The anchor
649+ point can be any of the predefined positions in the `Position` enum,
650+ such as `CENTER`, `CENTER_LEFT`, `BOTTOM_RIGHT`, etc.
648651
649652 Args:
650- anchor (Position): Position of bounding box anchor
651- for which to return the coordinates.
653+ anchor (Position): An enum specifying the position of the anchor point
654+ within the bounding box. Supported positions are defined in the
655+ `Position` enum.
652656
653657 Returns:
654- np.ndarray: An array of shape `(n, 2)` containing the bounding
655- box anchor coordinates in format `[x, y]`.
658+ np.ndarray: An array of shape `(n, 2)`, where `n` is the number of bounding
659+ boxes. Each row contains the `[x, y]` coordinates of the specified
660+ anchor point for the corresponding bounding box.
661+
662+ Raises:
663+ ValueError: If the provided `anchor` is not supported.
656664 """
657665 if anchor == Position .CENTER :
658666 return np .array (
Original file line number Diff line number Diff line change 66
77
88class Position (Enum ):
9+ """
10+ Enum representing the position of an anchor point.
11+ """
912 CENTER = "CENTER"
1013 CENTER_LEFT = "CENTER_LEFT"
1114 CENTER_RIGHT = "CENTER_RIGHT"
You canβt perform that action at this time.
0 commit comments