code: def plot_heatmaps(image, detections, figsize=5):
      """Plot."""
      figure = plt.figure(figsize=(figsize, figsize))
      plt.clf()
      width, height = image.shape[1], image.shape[0]
      if width != height:
          image = tf.image.pad_to_bounding_box(image, 0, 0, 640, 640)
          image = image.numpy()
  
      width, height = image.shape[1], image.shape[0]
  
      plt.imshow(
          np.concatenate(
              [
                  image.astype(float) / 255.0,
                  1.0 * np.ones([height, width, 1]),
              ],
              axis=-1,
          )
      )
      num_predicted_objects = (
          detections["detection_classes"].numpy().shape[0]
      )
      for object_id in range(num_predicted_objects):
          for k, color in [["centers", [0, 1, 0]]]:
              class_id = int(
                  detections["detection_classes"][object_id].numpy()
              )
              centers = detections[k][:, :, class_id].numpy()
              color = [[1, 0, 0], [0, 1, 0], [0, 0, 1]][object_id]
              plt.imshow(resize_heatmap(centers, color=color))
      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 3 for calling a global function with example usage: plot_heatmaps(image, detections, figsize) and returns: figure