class_docstr: CenterNet network using Hourglass from https://arxiv.org/abs/1904.07850S.
class_docstr_tok: ["CenterNet","network","using","Hourglass","from","https",":","\/\/arxiv.org\/abs\/1904.07850S","."]
docstr: Transform detections.
docstr_tok: ["Transform","detections","."]
code: def transform_detections(self, detections, metadata):
      """Transform detections."""
      all_detections = []
      batch_size, _, _ = detections.shape
      for ii in range(batch_size):
          metadata_ii = (
              metadata[ii, ...] if tf.rank(metadata) == 3 else metadata
          )
          output_size = metadata_ii[2, :] // self.output_stride
          points = tf.reshape(detections[ii, :, :4], [-1, 2])
          new_points = transforms.transform_predictions(
              points, metadata_ii[0, :], metadata_ii[1, :], output_size
          )
          detection = tf.concat(
              [tf.reshape(new_points, [-1, 4]), detections[ii, :, 4:]],
              axis=1,
          )
          all_detections.append(detection)
      return tf.stack(all_detections, axis=0)
  
imports: import collections
  import os
  import random
  import string
  import time
  from absl import logging
  import numpy
  import tensorflow
  from tensorflow_graphics.projects.points_to_3Dobjects.models import centernet_utils
  from tensorflow_graphics.projects.points_to_3Dobjects.networks import hourglass
  from tensorflow_graphics.projects.points_to_3Dobjects.transforms import transforms
  from tensorflow_graphics.projects.points_to_3Dobjects.utils import image
  from google3.pyglib import gfile
label_desc: Use image node_id 18 for calling the CenterNetVID obj's underlying member method code with example usage: obj.transform_detections(detections, metadata) and returns: tf