code: def visualize_pseudo_label(
      self,
      word_image,
      region_score,
      watershed_box,
      pseudo_char_bbox,
      img_name,
  ):
      word_img_h, word_img_w, _ = word_image.shape
      word_img_cp1 = word_image.copy()
      word_img_cp2 = word_image.copy()
      _watershed_box = np.int32(watershed_box)
      _pseudo_char_bbox = np.int32(pseudo_char_bbox)
  
      region_score_color = cv2.applyColorMap(
          np.uint8(region_score), cv2.COLORMAP_JET
      )
      region_score_color = cv2.resize(
          region_score_color, (word_img_w, word_img_h)
      )
  
      for box in _watershed_box:
          cv2.polylines(
              np.uint8(word_img_cp1),
              [np.reshape(box, (-1, 1, 2))],
              True,
              (255, 0, 0),
          )
  
      for box in _pseudo_char_bbox:
          cv2.polylines(
              np.uint8(word_img_cp2),
              [np.reshape(box, (-1, 1, 2))],
              True,
              (255, 0, 0),
          )
  
      # NOTE: Just for visualize, put gaussian map on char box
      pseudo_gt_region_score = self.gaussian_builder.generate_region(
          word_img_h, word_img_w, [_pseudo_char_bbox], [True]
      )
  
      pseudo_gt_region_score = cv2.applyColorMap(
          (pseudo_gt_region_score * 255).astype("uint8"),
          cv2.COLORMAP_JET,
      )
  
      overlay_img = cv2.addWeighted(
          word_image[:, :, ::-1], 0.7, pseudo_gt_region_score, 0.3, 5
      )
      vis_result = np.hstack(
          [
              word_image[:, :, ::-1],
              region_score_color,
              word_img_cp1[:, :, ::-1],
              word_img_cp2[:, :, ::-1],
              pseudo_gt_region_score,
              overlay_img,
          ]
      )
  
      if not os.path.exists(os.path.dirname(self.vis_test_dir)):
          os.makedirs(os.path.dirname(self.vis_test_dir))
      cv2.imwrite(
          os.path.join(
              self.vis_test_dir,
              "{}_{}".format(
                  img_name,
                  f"pseudo_char_bbox_{random.randint(0,100)}.jpg",
              ),
          ),
          vis_result,
      )
  
file_path: EasyOCR/trainer/craft/data/pseudo_label/make_charbox.py
imports: import os
  import random
  import math
  import numpy
  import cv2
  import torch
  from data import imgproc
  from data.pseudo_label.watershed import exec_watershed_by_version
label_desc: Use image node_id 4 for calling the PseudoCharBoxBuilder obj's underlying member method code with example usage: obj.visualize_pseudo_label(word_image, region_score, watershed_box, pseudo_char_bbox, img_name) without return types