def __init__(
        self, x0: float, y0: float, x1: float, y1: float, clip_values: bool = True
    ):
        """Initializes a BoundingBox object.

        Args:
            x0:
                x0 coordinate relative to image width.
            y0:
                y0 coordinate relative to image height.
            x1:
                x1 coordinate relative to image width.
            y1:
                y1 coordinate relative to image height.
            clip_values:
                If True, clips the coordinates to [0, 1].

        """
        if clip_values:

            def clip_to_0_1(value: float) -> float:
                return min(1, max(0, value))

            x0 = clip_to_0_1(x0)
            y0 = clip_to_0_1(y0)
            x1 = clip_to_0_1(x1)
            y1 = clip_to_0_1(y1)

        if x0 > 1 or x1 > 1 or y0 > 1 or y1 > 1 or x0 < 0 or x1 < 0 or y0 < 0 or y1 < 0:
            raise ValueError(
                f"Bounding Box Coordinates must be relative to "
                f"image width and height but are ({x0}, {y0}, {x1}, {y1})."
            )

        if x0 >= x1:
            raise ValueError(
                f"x0 must be smaller than x1 for bounding box [{x0}, {y0}, {x1}, {y1}]"
            )

        if y0 >= y1:
            raise ValueError(
                f"y0 must be smaller than y1 for bounding box [{x0}, {y0}, {x1}, {y1}]"
            )

        self.x0 = x0
        self.y0 = y0
        self.x1 = x1
        self.y1 = y1
Initializes a BoundingBox object.

        Args:
            x0:
                x0 coordinate relative to image width.
            y0:
                y0 coordinate relative to image height.
            x1:
                x1 coordinate relative to image width.
            y1:
                y1 coordinate relative to image height.
            clip_values:
                If True, clips the coordinates to [0, 1].

        
lightly/utils/bounding_box.py