code: def assign_offset_targets(
      gt_box_batch, gt_num_boxes_batch, stride, image_size
  ):
      """Assign offset."""
      # Returns offsets x,y
      height, width = image_size
  
      def _create_offsets(elems):
          gt_boxes = elems[0]
          gt_num_boxes = elems[1]
  
          num_boxes = tf.cast(gt_num_boxes, tf.int32)
          if tf.math.equal(num_boxes, 0):
              return tf.zeros(
                  (tf.shape(gt_boxes)[0], 2), dtype=tf.float32
              )
          boxes = box_list.BoxList(gt_boxes[:num_boxes, ...])
          boxes = box_list_ops.to_absolute_coordinates(
              boxes, height // stride, width // stride
          )
          (
              y_center,
              x_center,
              _,
              _,
          ) = boxes.get_center_coordinates_and_sizes()
          center = tf.stack([x_center, y_center], axis=1)
          center_floor = tf.math.floor(center)
          num_padding_boxes = (
              tf.shape(gt_boxes)[0] - tf.shape(center_floor)[0]
          )
          return tf.pad(
              center - center_floor, ((0, num_padding_boxes), (0, 0))
          )
  
      return tf.map_fn(
          _create_offsets,
          (gt_box_batch, gt_num_boxes_batch),
          dtype=tf.float32,
      )
  
file_path: graphics/tensorflow_graphics/projects/points_to_3Dobjects/transforms/targets.py
imports: import tensorflow
  from google3.third_party.tensorflow_models.object_detection.core import box_list
  from google3.third_party.tensorflow_models.object_detection.core import box_list_ops
label_desc: Use image node_id 5 for calling a global function with example usage: assign_offset_targets(gt_box_batch, gt_num_boxes_batch, stride, image_size) and returns: tf, tf, tf