code: def __init__(self, args, batch_size=1, perc_model=None, sess=None):
      self.sess = tf.get_default_session() if sess is None else sess
      K.set_session(self.sess)
      self.epsilon = 0.00000001
      self.args = args
      self.lr = args.lr
      self.decay_rate = args.decay_rate
      self.decay_steps = args.decay_steps
      self.img_size = args.image_size
      self.layer = args.use_vgg_layer
      self.vgg_loss = args.use_vgg_loss
      self.face_mask = args.face_mask
      if self.layer <= 0 or self.vgg_loss <= self.epsilon:
          self.vgg_loss = None
      self.pixel_loss = args.use_pixel_loss
      if self.pixel_loss <= self.epsilon:
          self.pixel_loss = None
      self.mssim_loss = args.use_mssim_loss
      if self.mssim_loss <= self.epsilon:
          self.mssim_loss = None
      self.lpips_loss = args.use_lpips_loss
      if self.lpips_loss <= self.epsilon:
          self.lpips_loss = None
      self.l1_penalty = args.use_l1_penalty
      if self.l1_penalty <= self.epsilon:
          self.l1_penalty = None
      self.adaptive_loss = args.use_adaptive_loss
      self.sharpen_input = args.sharpen_input
      self.batch_size = batch_size
      if perc_model is not None and self.lpips_loss is not None:
          self.perc_model = perc_model
      else:
          self.perc_model = None
      self.ref_img = None
      self.ref_weight = None
      self.ref_heatmaps = None
      self.perceptual_model = None
      self.ref_img_features = None
      self.features_weight = None
      self.loss = None
      self.discriminator_loss = args.use_discriminator_loss
      if self.discriminator_loss <= self.epsilon:
          self.discriminator_loss = None
      if self.discriminator_loss is not None:
          self.discriminator = None
          self.stub = create_stub(batch_size)
      self.landmark_loss = args.use_landmark_loss
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import tensorflow
  import bz2
  import PIL.Image
  from PIL import ImageFilter
  import numpy
  from keras.models import Model
  from keras.applications.vgg16 import VGG16, preprocess_input
  import keras.backend
  import traceback
  import external.stylegan2.dnnlib.tflib
  from core.landmark_handler import Landmark_Handler
  from core import arcface_handler
label_desc: Use image node_id 1 to create a new PerceptualModel object  with example: obj = PerceptualModel(args, batch_size, perc_model, sess)