code: def texture_editing(self, source_img, ref_img, mode):
      # read image
      image = source_img
      [h, w, _] = image.shape
      prn = self.network
      # -- 1. 3d reconstruction -> get texture.
      pos = prn.process(image)
      vertices = prn.get_vertices(pos)
      image = image / 255.0
      texture = cv2.remap(
          image,
          pos[:, :, :2].astype(np.float32),
          None,
          interpolation=cv2.INTER_NEAREST,
          borderMode=cv2.BORDER_CONSTANT,
          borderValue=(0),
      )
  
      # -- 2. Texture Editing
      Mode = mode
      # change part of texture(for data augumentation/selfie editing. Here modify eyes for example)
      if Mode == 0:
          # load eye mask
          uv_face_eye = (
              imread(
                  os.path.join(
                      self.directory, "Data/uv-data/uv_face_eyes.png"
                  ),
                  as_gray=True,
              )
              / 255.0
          )
          uv_face = (
              imread(
                  os.path.join(
                      self.directory, "Data/uv-data/uv_face.png"
                  ),
                  as_gray=True,
              )
              / 255.0
          )
          eye_mask = (abs(uv_face_eye - uv_face) > 0).astype(np.float32)
  
          # texture from another image or a processed texture
          ref_image = ref_img
          ref_pos = prn.process(ref_image)
          ref_image = ref_image / 255.0
          ref_texture = cv2.remap(
              ref_image,
              ref_pos[:, :, :2].astype(np.float32),
              None,
              interpolation=cv2.INTER_NEAREST,
              borderMode=cv2.BORDER_CONSTANT,
              borderValue=(0),
          )
  
          # modify texture
          new_texture = (
              texture * (1 - eye_mask[:, :, np.newaxis])
              + ref_texture * eye_mask[:, :, np.newaxis]
          )
  
      # change whole face(face swap)
      elif Mode == 1:
          # texture from another image or a processed texture
          ref_image = ref_img
          ref_pos = prn.process(ref_image)
          ref_image = ref_image / 255.0
          ref_texture = cv2.remap(
              ref_image,
              ref_pos[:, :, :2].astype(np.float32),
              None,
              interpolation=cv2.INTER_NEAREST,
              borderMode=cv2.BORDER_CONSTANT,
              borderValue=(0),
          )
          ref_vertices = prn.get_vertices(ref_pos)
          new_texture = ref_texture  # (texture + ref_texture)/2.
  
      else:
          print("Wrong Mode! Mode should be 0 or 1.")
          exit()
  
      # -- 3. remap to input image.(render)
      vis_colors = np.ones((vertices.shape[0], 1))
      face_mask = render_texture(
          vertices.T, vis_colors.T, prn.triangles.T, h, w, c=1
      )
      face_mask = np.squeeze(face_mask > 0).astype(np.float32)
  
      new_colors = prn.get_colors_from_texture(new_texture)
      new_image = render_texture(
          vertices.T, new_colors.T, prn.triangles.T, h, w, c=3
      )
      new_image = (
          image * (1 - face_mask[:, :, np.newaxis])
          + new_image * face_mask[:, :, np.newaxis]
      )
  
      # Possion Editing for blending image
      vis_ind = np.argwhere(face_mask > 0)
      vis_min = np.min(vis_ind, 0)
      vis_max = np.max(vis_ind, 0)
      center = (
          int((vis_min[1] + vis_max[1]) / 2 + 0.5),
          int((vis_min[0] + vis_max[0]) / 2 + 0.5),
      )
      output = cv2.seamlessClone(
          (new_image * 255).astype(np.uint8),
          (image * 255).astype(np.uint8),
          (face_mask * 255).astype(np.uint8),
          center,
          cv2.NORMAL_CLONE,
      )
  
      return output
  
imports: import argparse
  import copy
  import os
  import cv2
  import numpy
  import paddle
  from skimage.io import imread
  from skimage.transform import rescale
  from skimage.transform import resize
  import paddlehub
  from .api import PRN
  from .predictor import PosPrediction
  from .util import base64_to_cv2
  from .utils.render import render_texture
  from paddlehub.module.module import moduleinfo
  from paddlehub.module.module import runnable
  from paddlehub.module.module import serving
label_desc: Use image node_id 3 for calling the PRNet obj's underlying member method code with example usage: obj.texture_editing(source_img, ref_img, mode) and returns: output