code: def _save_imgs(self, alpha, img_path, fg=None):
      ori_img = cv2.imread(img_path)
      alpha = (alpha * 255).astype("uint8")
  
      if self.imgs_dir is not None:
          img_path = img_path.replace(self.imgs_dir, "")
      else:
          img_path = os.path.basename(img_path)
      name, ext = os.path.splitext(img_path)
      if name[0] == "/" or name[0] == "\\":
          name = name[1:]
  
      alpha_save_path = os.path.join(args.save_dir, name + "_alpha.png")
      rgba_save_path = os.path.join(args.save_dir, name + "_rgba.png")
  
      # save alpha
      mkdir(alpha_save_path)
      cv2.imwrite(alpha_save_path, alpha)
  
      # save rgba image
      mkdir(rgba_save_path)
      if fg is None:
          if args.fg_estimate:
              fg = (
                  estimate_foreground_ml(ori_img / 255.0, alpha / 255.0)
                  * 255
              )
          else:
              fg = ori_img
      else:
          fg = fg * 255
      fg = fg.astype("uint8")
      alpha = alpha[:, :, np.newaxis]
      rgba = np.concatenate([fg, alpha], axis=-1)
      cv2.imwrite(rgba_save_path, rgba)
  
imports: import argparse
  import codecs
  import os
  import sys
  import cv2
  import tqdm
  import yaml
  import numpy
  import paddle
  from paddle.inference import create_predictor, PrecisionType
  from paddle.inference import Config
  from paddleseg.cvlibs import manager
  from paddleseg.utils import get_sys_env, logger
  import ppmatting.transforms
  from ppmatting.utils import get_image_list, mkdir, estimate_foreground_ml, VideoReader, VideoWriter
label_desc: Use image node_id 8 for calling the Predictor obj's underlying member method code with example usage: obj._save_imgs(alpha, img_path, fg) without return types