code: def cxcywha_to_corners(
      cxcywha: Array, np_backbone: PyModule = jnp
  ) -> Array:
      """Convert [cx, cy, w, h, a] to four corners of [x, y].
  
      Args:
        cxcywha: [..., 5]-ndarray of [center-x, center-y, width, height, angle]
        representation of rotated boxes. Angle is in radians and center of rotation
        is defined by [center-x, center-y] point.
        np_backbone: Numpy module: Either the regular numpy package or jax.numpy.
  
      Returns:
        [..., 4, 2]-ndarray of four corners of the rotated box as [x, y] points.
      """
      assert (
          cxcywha.shape[-1] == 5
      ), "Expected [..., [cx, cy, w, h, a] input."
      bs = cxcywha.shape[:-1]
      cx, cy, w, h, a = np_backbone.split(
          cxcywha, indices_or_sections=5, axis=-1
      )
      xs = np_backbone.array([0.5, 0.5, -0.5, -0.5]) * w
      ys = np_backbone.array([-0.5, 0.5, 0.5, -0.5]) * h
      pts = np_backbone.stack([xs, ys], axis=-1)
      sin = np_backbone.sin(a)
      cos = np_backbone.cos(a)
      rot = np_backbone.concatenate(
          [cos, -sin, sin, cos], axis=-1
      ).reshape((*bs, 2, 2))
      offset = np_backbone.concatenate([cx, cy], -1).reshape(
          (*bs, 1, 2)
      )
      corners = pts @ rot + offset
      return corners
  
file_path: scenic/scenic/model_lib/base_models/box_utils.py
imports: from typing import Any, Union
  import jax.numpy
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: cxcywha_to_corners(cxcywha, np_backbone) and returns: corners