code: def mat_to_png(mat_file, sbd_cls_dir, save_dir):
      mat_path = os.path.join(sbd_cls_dir, mat_file)
      mat = loadmat(mat_path)
      mask = mat["GTcls"][0]["Segmentation"][0].astype(np.uint8)
      save_file = os.path.join(save_dir, mat_file.replace("mat", "png"))
      cv2.imwrite(save_file, mask)
  
file_path: PaddleSeg/tools/data/voc_augment.py
imports: import os
  import argparse
  from multiprocessing import Pool, cpu_count
  import cv2
  import numpy
  from scipy.io import loadmat
  import tqdm
  from paddleseg.utils.download import download_file_and_uncompress
label_desc: Use image node_id 2 for calling a global function with example usage: mat_to_png(mat_file, sbd_cls_dir, save_dir) without return types