code: def __init__(self, config, need_parser=True):
      self.img_size = 256
      self.transform = transform = T.Compose(
          [
              T.Resize(size=256),
              T.ToTensor(),
          ]
      )
      self.norm = T.Normalize([0.5, 0.5, 0.5], [0.5, 0.5, 0.5])
      if need_parser:
          self.face_parser = futils.mask.FaceParser()
      self.up_ratio = 0.6 / 0.85
      self.down_ratio = 0.2 / 0.85
      self.width_ratio = 0.2 / 0.85
  
imports: import argparse
  import os
  import sys
  from pathlib import Path
  import numpy
  import paddle
  import paddle.vision.transforms
  import ppgan.faceutils
  from paddle.utils.download import get_weights_path_from_url
  from PIL import Image
  from ppgan.models.builder import build_model
  from ppgan.utils.config import get_config
  from ppgan.utils.filesystem import load
  from ppgan.utils.options import parse_args
  from ppgan.utils.preprocess import *
label_desc: Use image node_id 1 to create a new PreProcess object  with example: obj = PreProcess(config, need_parser)