code: def visualize_imgs(args):
      file_path = args.file_path
      pred_dir = args.pred_dir
      save_dir = args.save_dir
      weight = 0.1
  
      images_path = get_images_path(file_path)
      bar = progbar.Progbar(target=len(images_path), verbose=1)
      mkdir(save_dir, True)
  
      for idx, (origin_path, annot_path) in enumerate(images_path):
          origin_img = Image.open(origin_path)
          annot_img = Image.open(annot_path)
          annot_img = np.array(annot_img)
          wt_annot_img = None
          wt_pred_img = None
          color_map = visualize.get_color_map_list(256)
  
          # weighted annoted image
          wt_annot_img = utils.visualize.visualize(
              origin_path, annot_img, color_map, weight=weight
          )
          wt_annot_img = Image.fromarray(
              cv2.cvtColor(wt_annot_img, cv2.COLOR_BGR2RGB)
          )
  
          # weighted predicted image
          if pred_dir is not None:
              image_name = os.path.split(origin_path)[-1]
              tmp_name = image_name.replace("jpg", "png")
              pred_path = os.path.join(pred_dir, tmp_name)
              if os.path.exists(pred_path):
                  pred_img = np.array(Image.open(pred_path))
                  wt_pred_img = utils.visualize.visualize(
                      origin_path, pred_img, color_map, weight=weight
                  )
                  wt_pred_img = Image.fromarray(
                      cv2.cvtColor(wt_pred_img, cv2.COLOR_BGR2RGB)
                  )
  
          # result image
          imgs = [origin_img, wt_annot_img]
          if wt_pred_img is not None:
              imgs.append(wt_pred_img)
          result_img = visualize.paste_images(imgs)
  
          image_name = os.path.split(origin_path)[-1]
          result_img.save(os.path.join(save_dir, image_name))
  
          bar.update(idx + 1)
  
file_path: PaddleSeg/tools/data/visualize_annotation.py
imports: import argparse
  import os
  import shutil
  import cv2
  import numpy
  from PIL import Image
  from paddleseg import utils
  from paddleseg.utils import progbar, visualize
label_desc: Use image node_id 4 for calling a global function with example usage: visualize_imgs(args) without return types