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","."]
code: def __init__(self, hr_channels: int = 32, pretrained=None):
      super(MODNetHRNet18, self).__init__()
  
      self.backbone = HRNet_W18()
      self.pretrained = pretrained
  
      self.head = MODNetHead(
          hr_channels=hr_channels,
          backbone_channels=self.backbone.feat_channels,
      )
      self.blurer = GaussianBlurLayer(1, 3)
      self.transforms = P.Compose(
          [
              P.LoadImages(),
              P.ResizeByShort(),
              P.ResizeToIntMult(),
              P.Normalize(),
          ]
      )
  
      if pretrained is not None:
          model_dict = paddle.load(pretrained)
          self.set_dict(model_dict)
          print("load custom parameters success")
  
      else:
          checkpoint = os.path.join(
              self.directory, "modnet-hrnet_w18.pdparams"
          )
          model_dict = paddle.load(checkpoint)
          self.set_dict(model_dict)
          print("load pretrained parameters success")
  
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 1 to create a new MODNetHRNet18 object from inherited base classes: nn with example: obj = MODNetHRNet18(hr_channels, pretrained)