code: def _save_frame(self, alpha, fg, img, writer_alpha, writer_fg):
      if fg is None:
          img = img.transpose((1, 2, 0))
          if self.args.fg_estimate:
              fg = estimate_foreground_ml(img, alpha)
          else:
              fg = img
      fg = fg * alpha[:, :, np.newaxis]
  
      writer_alpha.write(alpha)
      writer_fg.write(fg)
  
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 10 for calling the Predictor obj's underlying member method code with example usage: obj._save_frame(alpha, fg, img, writer_alpha, writer_fg) without return types