class_docstr: The MODNet implementation based on PaddlePaddle.
  
  The original article refers to
  Zhanghan Ke, et, al. "Is a Green Screen Really Necessary for Real-Time Portrait Matting?"
  (https://arxiv.org/pdf/2011.11961.pdf).
  
  Args:
      hr_channels(int, optional): The channels of high resolutions branch. Defautl: None.
      pretrained(str, optional): The path of pretrianed model. Defautl: None.
class_docstr_tok: ["The","MODNet","implementation","based","on","PaddlePaddle",".","The","original","article","refers","to","Zhanghan","Ke",",","et",",","al",".","``","Is","a","Green","Screen","Really","Necessary","for","Real-Time","Portrait","Matting","?","''","(","https",":","\/\/arxiv.org\/pdf\/2011.11961.pdf",")",".","Args",":","hr_channels","(","int",",","optional",")",":","The","channels","of","high","resolutions","branch",".","Defautl",":","None",".","pretrained","(","str",",","optional",")",":","The","path","of","pretrianed","model",".","Defautl",":","None","."]
docstr: Run as a command.
docstr_tok: ["Run","as","a","command","."]
code: def run_cmd(self, argvs: list):
      """
      Run as a command.
      """
      self.parser = argparse.ArgumentParser(
          description="Run the {} module.".format(self.name),
          prog="hub run {}".format(self.name),
          usage="%(prog)s",
          add_help=True,
      )
      self.arg_input_group = self.parser.add_argument_group(
          title="Input options", description="Input data. Required"
      )
      self.arg_config_group = self.parser.add_argument_group(
          title="Config options",
          description="Run configuration for controlling module behavior, not required.",
      )
      self.add_module_config_arg()
      self.add_module_input_arg()
      args = self.parser.parse_args(argvs)
      if args.trimap_path is not None:
          trimap_list = [args.trimap_path]
      else:
          trimap_list = None
  
      results = self.predict(
          image_list=[args.input_path],
          trimap_list=trimap_list,
          save_path=args.output_dir,
          visualization=args.visualization,
      )
  
      return results
  
imports: import os
  import time
  import argparse
  from typing import Callable, Union, List, Tuple
  import numpy
  import cv2
  import scipy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddlehub.module.module import moduleinfo
  import paddlehub.vision.segmentation_transforms
  from paddlehub.module.module import moduleinfo, runnable, serving
  from modnet_hrnet18_matting.hrnet import HRNet_W18
  import modnet_hrnet18_matting.processor
label_desc: Use image node_id 6 for calling the MODNetHRNet18 obj's underlying member method code with example usage: obj.run_cmd(argvs) and returns: results