code: def numpy_grayscale_to_heatmap_figure(data: np.ndarray):
      """Create heatmap graph object from given numpy array data."""
      dimension = data.shape[2]
      if dimension == 3:
          data = cv2.cvtColor(data, cv2.COLOR_RGB2GRAY)
      elif dimension != 1:
          raise DeepchecksValueError(
              f"Don't know to plot images with {dimension} dimensions"
          )
      return go.Heatmap(
          z=data.squeeze(), hoverinfo="skip", coloraxis="coloraxis"
      )
  
imports: import io
  import typing
  from numbers import Number
  from pathlib import Path
  import cv2
  import numpy
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageOps
  import plotly.graph_objects
  from PIL import ImageColor, ImageFont
  from deepchecks.core.errors import DeepchecksValueError
  from deepchecks.utils.html import imagetag
  from deepchecks.vision.vision_data import TaskType
  from deepchecks.vision.vision_data.utils import LabelMap
  from .detection_formatters import convert_bbox
label_desc: Use image node_id 7 for calling a global function with example usage: numpy_grayscale_to_heatmap_figure(data) and returns: go