code: def compute_maps(heatmap, image_height, image_width, lines):
      assert image_height % 2 == 0, "Height must be an even number"
      assert image_width % 2 == 0, "Width must be an even number"
  
      textmap = np.zeros((image_height // 2, image_width // 2)).astype(
          "float32"
      )
      linkmap = np.zeros((image_height // 2, image_width // 2)).astype(
          "float32"
      )
  
      src = np.array(
          [
              [0, 0],
              [heatmap.shape[1], 0],
              [heatmap.shape[1], heatmap.shape[0]],
              [0, heatmap.shape[0]],
          ]
      ).astype("float32")
  
      for line in lines:
          line, orientation = tools.fix_line(line)
          previous_link_points = None
          for [(x1, y1), (x2, y2), (x3, y3), (x4, y4)], c in line:
              x1, y1, x2, y2, x3, y3, x4, y4 = map(
                  lambda v: max(v, 0), [x1, y1, x2, y2, x3, y3, x4, y4]
              )
              if c == " ":
                  previous_link_points = None
                  continue
              yc = (y4 + y1 + y3 + y2) / 4
              xc = (x1 + x2 + x3 + x4) / 4
              if orientation == "horizontal":
                  current_link_points = (
                      np.array(
                          [
                              [
                                  (xc + (x1 + x2) / 2) / 2,
                                  (yc + (y1 + y2) / 2) / 2,
                              ],
                              [
                                  (xc + (x3 + x4) / 2) / 2,
                                  (yc + (y3 + y4) / 2) / 2,
                              ],
                          ]
                      )
                      / 2
                  )
              else:
                  current_link_points = (
                      np.array(
                          [
                              [
                                  (xc + (x1 + x4) / 2) / 2,
                                  (yc + (y1 + y4) / 2) / 2,
                              ],
                              [
                                  (xc + (x2 + x3) / 2) / 2,
                                  (yc + (y2 + y3) / 2) / 2,
                              ],
                          ]
                      )
                      / 2
                  )
              character_points = (
                  np.array(
                      [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
                  ).astype("float32")
                  / 2
              )
              # pylint: disable=unsubscriptable-object
              if previous_link_points is not None:
                  if orientation == "horizontal":
                      link_points = np.array(
                          [
                              previous_link_points[0],
                              current_link_points[0],
                              current_link_points[1],
                              previous_link_points[1],
                          ]
                      )
                  else:
                      link_points = np.array(
                          [
                              previous_link_points[0],
                              previous_link_points[1],
                              current_link_points[1],
                              current_link_points[0],
                          ]
                      )
                  ML = cv2.getPerspectiveTransform(
                      src=src,
                      dst=link_points.astype("float32"),
                  )
                  linkmap += cv2.warpPerspective(
                      heatmap,
                      ML,
                      dsize=(linkmap.shape[1], linkmap.shape[0]),
                  ).astype("float32")
              MA = cv2.getPerspectiveTransform(
                  src=src,
                  dst=character_points,
              )
              textmap += cv2.warpPerspective(
                  heatmap,
                  MA,
                  dsize=(textmap.shape[1], textmap.shape[0]),
              ).astype("float32")
              # pylint: enable=unsubscriptable-object
              previous_link_points = current_link_points
      return (
          np.concatenate(
              [textmap[..., np.newaxis], linkmap[..., np.newaxis]],
              axis=2,
          ).clip(0, 255)
          / 255
      )
  
imports: import typing
  import cv2
  import numpy
  import tensorflow
  import efficientnet.tfkeras
  from tensorflow import keras
  from .None import tools
label_desc: Use image node_id 6 for calling a global function with example usage: compute_maps(heatmap, image_height, image_width, lines) and returns: unknown