code: def overlay(image, region, affinity, single_img_bbox):
      height, width, channel = image.shape
  
      region_score = cv2.resize(region, (width, height))
      affinity_score = cv2.resize(affinity, (width, height))
  
      overlay_region = cv2.addWeighted(
          image.copy(), 0.4, region_score, 0.6, 5
      )
      overlay_aff = cv2.addWeighted(
          image.copy(), 0.4, affinity_score, 0.6, 5
      )
  
      boxed_img = image.copy()
      for word_box in single_img_bbox:
          cv2.polylines(
              boxed_img,
              [word_box.astype(np.int32).reshape((-1, 1, 2))],
              True,
              color=(0, 255, 0),
              thickness=3,
          )
  
      temp1 = np.hstack([image, boxed_img])
      temp2 = np.hstack([overlay_region, overlay_aff])
      temp3 = np.vstack([temp1, temp2])
  
      return temp3
  
imports: import argparse
  import os
  import cv2
  import numpy
  import torch
  import torch.backends.cudnn
  from tqdm import tqdm
  import wandb
  from config.load_config import load_yaml, DotDict
  from model.craft import CRAFT
  from metrics.eval_det_iou import DetectionIoUEvaluator
  from utils.inference_boxes import test_net, load_icdar2015_gt, load_icdar2013_gt, load_synthtext_gt
  from utils.util import copyStateDict
label_desc: Use image node_id 4 for calling a global function with example usage: overlay(image, region, affinity, single_img_bbox) and returns: temp3