class_docstr: Class which unifies different bounding box formats.
  
  Attributes:
      x0:
          x0 coordinate (normalized to [0, 1])
      y0:
          y0 coordinate (normalized to [0, 1])
      x1:
          x1 coordinate (normalized to [0, 1])
      y1:
          y1 coordinate (normalized to [0, 1])
  
  Examples:
      >>> # simple case, format (x0, y0, x1, y1)
      >>> bbox = BoundingBox(0.1, 0.2, 0.3, 0.4)
      >>>
      >>> # same bounding box in x, y, w, h format
      >>> bbox = BoundingBox.from_x_y_w_h(0.1, 0.2, 0.2, 0.2)
      >>>
      >>> # often the coordinates are not yet normalized by image size
      >>> # for example, for a 100 x 100 image, the coordinates could be
      >>> # (x0, y0, x1, y1) = (10, 20, 30, 40)
      >>> W, H = 100, 100 # get image shape
      >>> bbox = BoundingBox(10 / W, 20 / H, 30 / W, 40 / H)
docstr: Helper to convert from yolo label format
  x_center, y_center, w, h --> x0, y0, x1, y1
  
  Examples:
      >>> bbox = BoundingBox.from_yolo(0.5, 0.4, 0.2, 0.3)
docstr_tok: ["Helper","to","convert","from","yolo","label","format","x_center",",","y_center",",","w",",","h","--",">","x0",",","y0",",","x1",",","y1","Examples",":",">",">",">","bbox","=","BoundingBox.from_yolo","(","0.5",",","0.4",",","0.2",",","0.3",")"]
code: def from_yolo_label(
      cls, x_center: float, y_center: float, w: float, h: float
  ) -> BoundingBox:
      """Helper to convert from yolo label format
      x_center, y_center, w, h --> x0, y0, x1, y1
  
      Examples:
          >>> bbox = BoundingBox.from_yolo(0.5, 0.4, 0.2, 0.3)
  
      """
      return cls(
          x_center - w / 2,
          y_center - h / 2,
          x_center + w / 2,
          y_center + h / 2,
          clip_values=True,
      )
  
file_path: lightly/lightly/utils/bounding_box.py
imports: from __future__ import annotations
label_desc: Use image node_id 3 for calling the BoundingBox obj's underlying member method code with example usage: obj.from_yolo_label(cls, x_center, y_center, w, h) and returns: cls