code: def add_image_vdl(
      writer, im, pred, label, epoch, channel, with_overlay=True
  ):
      # different channel, overlay, different epoch, multiple image in a epoch
      im_clone = im.clone().detach().squeeze().numpy()
      pred_clone = pred.clone().detach().squeeze().numpy()  # [D, H, W]
      label_clone = label.clone().detach().squeeze().numpy()
  
      step = pred_clone.shape[0] // 5
      for i in range(5):
          index = i * step
          writer.add_image(
              "Evaluate/image_{}".format(i),
              im_clone[:, :, index : index + 1],
              iter,
          )
          writer.add_image(
              "Evaluate/pred_{}".format(i),
              pred_clone[:, :, index : index + 1],
              iter,
          )
          writer.add_image(
              "Evaluate/imagewithpred_{}".format(i),
              0.2 * pred_clone[:, :, index : index + 1]
              + 0.8 * im_clone[:, :, index : index + 1],
              iter,
          )
          writer.add_image(
              "Evaluate/label_{}".format(i),
              label_clone[:, :, index : index + 1],
              iter,
          )
  
      print(
          "[EVAL] Sucessfully save iter {} pred and label.".format(iter)
      )
  
file_path: PaddleSeg/contrib/MedicalSeg/medicalseg/utils/visualize.py
imports: import os
  import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 for calling a global function with example usage: add_image_vdl(writer, im, pred, label, epoch, channel, with_overlay) without return types