code: def plot_detections(
      image,
      intrinsics,
      pose_world2camera,
      detections,
      labels,
      figsize=0.1,
  ):
      """Plot."""
      figure = plt.figure(figsize=(figsize, figsize))
      plt.clf()
      plt.imshow(
          np.concatenate(
              [
                  image.astype(float) / 255.0,
                  0.2 * np.ones([256, 256, 1]),
              ],
              axis=-1,
          )
      )
  
      # Plot heatmaps
      num_predicted_objects = (
          detections["detection_classes"].numpy().shape[0]
      )
      for object_id in range(num_predicted_objects):
          for k, color in [
              ["centers_sigmoid", [0, 1, 0]],
              ["centers_nms", [1, 0, 0]],
          ]:
              class_id = int(
                  detections["detection_classes"][object_id].numpy()
              )
              centers = detections[k][:, :, class_id].numpy()
              plt.imshow(resize_heatmap(centers, color=color))
  
      intrinsics = np.reshape(intrinsics, [3, 3])
      pose_world2camera = np.reshape(pose_world2camera, [3, 4])
  
      for j, [boxes, style] in enumerate(
          [[labels, "dashed"], [detections, "solid"]]
      ):
          number_of_boxes = boxes["detection_boxes"].shape[0]
          for i in range(number_of_boxes):
              predicted_pose_obj2world = np.eye(4)
              predicted_pose_obj2world[0:3, 0:3] = boxes[
                  "rotations_3d"
              ][i].numpy()
              predicted_pose_obj2world[0:3, 3] = boxes["center3d"][
                  i
              ].numpy()
              draw_bounding_box_3d(
                  boxes["size3d"].numpy()[i],
                  predicted_pose_obj2world,
                  intrinsics,
                  pose_world2camera,
                  linestyle=style,
              )
              if j == 0:
                  if isinstance(boxes["detection_boxes"], tf.Tensor):
                      boxes["detection_boxes"] = boxes[
                          "detection_boxes"
                      ].numpy()
                  # if isinstance(boxes['detection_classes'], tf.Tensor):
                  #   boxes['detection_classes'] = boxes['detection_classes'].numpy()
  
                  x_min, y_min, x_max, y_max = boxes["detection_boxes"][
                      i
                  ]
                  # plt.text(x_min, y_min,
                  #          class_id_to_name[int(boxes['detection_classes'][i])])
                  plt.plot(
                      [x_min, x_max, x_max, x_min, x_min],
                      [y_min, y_min, y_max, y_max, y_min],
                      linestyle=style,
                  )
  
      plt.axis("off")
      plt.tight_layout()
      return figure
  
imports: import os
  import pickle
  import re
  import matplotlib.pyplot
  import numpy
  import tensorflow
  from tensorflow_graphics.projects.points_to_3Dobjects.utils import tf_utils
  from google3.pyglib import gfile
label_desc: Use image node_id 10 for calling a global function with example usage: plot_detections(image, intrinsics, pose_world2camera, detections, labels, figsize) and returns: figure