code: def get_box_area(
      boxes: tf.Tensor, image_size: Optional[SizeTuple] = None
  ) -> tf.Tensor:
      """Calculate area using box coordinates.
  
      Arguments:
        boxes: Relative box coordinates.
        image_size: If provided, size of the image to use for calculating the
          absolute box area.
  
      Returns:
        Box area.
      """
      box_height = boxes[..., 2] - boxes[..., 0]
      box_width = boxes[..., 3] - boxes[..., 1]
      area = box_height * box_width
  
      if image_size is not None:
          image_height, image_width = image_size
          image_height = tf.cast(image_height, area.dtype)
          image_width = tf.cast(image_width, area.dtype)
          area *= image_height * image_width
      return area
  
file_path: scenic/scenic/projects/owl_vit/preprocessing/transforms.py
imports: from typing import Any, Optional, Sequence, Tuple, Union
  import tensorflow
label_desc: Use image node_id 2 for calling a global function with example usage: get_box_area(boxes, image_size) and returns: area