code: def _affine_transform_points_np(
      bounding_boxes,
      original_image_size,
      center,
      side_size,
      output_size,
      flip,
  ):
      """Affine transform points."""
      bounding_boxes_np = bounding_boxes.numpy()
      bounding_boxes_shape = bounding_boxes_np.shape
      original_image_size_np = original_image_size.numpy()
  
      if len(bounding_boxes_shape) == 3:
          bounding_boxes_np = np.reshape(bounding_boxes_np, [-1, 4])
  
      h, w = original_image_size_np[:2]
  
      if flip:
          bounding_boxes_np[..., [1, 3]] = (
              1.0 - bounding_boxes_np[..., [3, 1]]
          )
  
      bounding_boxes_np = bounding_boxes_np * [h, w, h, w]
  
      box_min = np.stack(
          [bounding_boxes_np[:, 1], bounding_boxes_np[:, 0]], axis=1
      )
      box_max = np.stack(
          [bounding_boxes_np[:, 3], bounding_boxes_np[:, 2]], axis=1
      )
      box_min = image_utils.transform_points(
          box_min,
          center.numpy(),
          side_size.numpy(),
          output_size.numpy(),
          False,
      )
      box_max = image_utils.transform_points(
          box_max,
          center.numpy(),
          side_size.numpy(),
          output_size.numpy(),
          False,
      )
      box_min = np.stack([box_min[:, 1], box_min[:, 0]], axis=1)
      box_max = np.stack([box_max[:, 1], box_max[:, 0]], axis=1)
  
      bounding_boxes_np = np.concatenate([box_min, box_max], axis=1)
  
      h, w = output_size.numpy()[:2]
      bounding_boxes_np = np.clip(
          bounding_boxes_np / [h, w, h, w], 0.0, 1.0
      )
  
      if len(bounding_boxes_shape) == 3:
          bounding_boxes_np = np.reshape(
              bounding_boxes_np, bounding_boxes_shape
          )
  
      return bounding_boxes_np.astype(np.float32)
  
imports: import functools
  import cv2
  import numpy
  import tensorflow
  from tensorflow_graphics.projects.points_to_3Dobjects.utils import image
  from google3.third_party.tensorflow_models.object_detection.core import preprocessor
label_desc: Use image node_id 13 for calling a global function with example usage: _affine_transform_points_np(bounding_boxes, original_image_size, center, side_size, output_size, flip) and returns: bounding_boxes_np