code: def get_tmesh(self, im, reconstruction_dict, face_mask):
      id_features = self.arcface_handler.get_identity_features(
          im, reconstruction_dict["dense_lms"][self.lms_ind]
      )
  
      _, yaw_angle, _ = reconstruction_dict["euler_angles"]
      is_profile = np.abs(yaw_angle * 180 / np.pi) > 30
      visibility_threshold = 0.4
      dense_lms = reconstruction_dict["dense_lms"] / im.shape[::-1]
      dense_lms[:, 1] = 1 - dense_lms[:, 1]
  
      im_masked = np.array(im_menpo2PIL(im))
      mask_landmarks = np.ones_like(im_masked[:, :, 0])
      if face_mask is not None:
          im_masked = im_masked * np.repeat(
              np.expand_dims(np.array(face_mask, np.bool), 2), 3, 2
          )
          mask_landmarks *= np.array(face_mask, np.uint8)
  
      im_masked = fill_UV(im_PIL2menpo(im_masked))
      im_masked.pixels = np.concatenate(
          [im_masked.pixels, np.expand_dims(mask_landmarks, 0)], 0
      )
      img_uv_src = self.render_uv_image(im_masked, dense_lms[self.mask])
      mask_landmarks = img_uv_src.pixels[3] < 0.5
      img_uv_src.pixels = img_uv_src.pixels[0:3]
      img_uv_src = fill_UV(img_uv_src)
      if is_profile:
          mask_landmarks = binary_dilation(mask_landmarks, disk(5))
          visibility_threshold = 0.6
      img_uv_src.pixels[:, mask_landmarks] = 0
      tcoords = self.tcoords_full.copy()
      tcoords.points[self.mask] = self.tcoords.points
  
      tmesh = TexturedTriMesh(
          reconstruction_dict["vertices"],
          tcoords.points,
          img_uv_src,
          trilist=reconstruction_dict["trilist"],
      )
      tmesh_masked = tmesh.from_mask(self.mask)
      tmesh_rotated = TexturedTriMesh(
          reconstruction_dict["vertices_rotated"],
          tmesh.tcoords.points,
          tmesh.texture,
          trilist=tmesh.trilist,
      )
      view_angle_src = self.camera_tri_angle_src(tmesh_rotated)
      view_angle_src_masked = view_angle_src[self.mask]
      view_angle_src_masked[
          ~self.tight_mask[self.mask]
      ] = -1  # Only take tight crop from the original image
      angle_uv_src, visible = self.render_colored_image(
          view_angle_src_masked, return_visibility=True
      )
      angle_uv_src.pixels[:, ~visible | mask_landmarks] = -1.0
  
      mask = angle_uv_src.pixels[0] < visibility_threshold
      mask = ~remove_small_holes(~mask, area_threshold=100000)
  
      if is_profile and self.mode == "soft":
          mask = binary_dilation(mask, disk(10))
          img_uv_src.pixels[:, mask] = 0
          angle_uv_src.pixels[:, mask] = -1
  
          img_uv_src_flipped = img_uv_src.mirror(1)
          angle_uv_src_flipped = angle_uv_src.mirror(1)
          temp = img_uv_src_flipped.pixels
          pad = int((16 / 1024) * self.uv_shape[1])
          img_uv_src_flipped.pixels = np.concatenate(
              [
                  np.zeros([temp.shape[0], temp.shape[1], pad]),
                  temp[:, :, :-pad],
              ],
              2,
          )
          temp = angle_uv_src_flipped.pixels
          angle_uv_src_flipped.pixels = np.concatenate(
              [
                  np.zeros([temp.shape[0], temp.shape[1], pad]),
                  temp[:, :, :-pad],
              ],
              2,
          )
  
          img_uv_src_flipped = fill_UV(img_uv_src_flipped)
          img_uv_src = fill_UV(img_uv_src)
          mask_flipped = (
              angle_uv_src_flipped.pixels[0] > visibility_threshold
          ) & mask
          mask_flipped = remove_small_holes(
              mask_flipped, area_threshold=100000
          )
          # mask_flipped = binary_dilation(mask_flipped, disk(15))
          angle_uv_src.pixels = (
              mask_flipped * angle_uv_src_flipped.pixels
              + (1 - mask_flipped) * angle_uv_src.pixels
          )
  
          mask_all = mask_flipped.astype(int).copy()
          mask_all[~mask_flipped & ~mask] = 2
          mask_all = fill_UV(
              Image(np.tile(mask_all, [3, 1, 1]))
          ).pixels[0]
  
          mask_flipped_g = gaussian(
              mask_all == 1, sigma=30, multichannel=True, mode="reflect"
          )
          mask_flipped_inv_g = gaussian(
              mask_all == 2, sigma=30, multichannel=True, mode="reflect"
          )
  
          img_uv_src.pixels = (
              mask_flipped_g * img_uv_src_flipped.pixels
              + mask_flipped_inv_g * img_uv_src.pixels
          )
          # img_uv_src.pixels[:,mask_flipped] = img_uv_src_flipped.pixels[:,mask_flipped]
  
          mask = angle_uv_src.pixels[0] < visibility_threshold
          mask = ~remove_small_holes(~mask, area_threshold=100000)
          # mask = binary_dilation(mask, disk(15))
          img_uv_src.pixels[:, mask] = 0
          angle_uv_src.pixels[:, mask] = -1
  
      img_uv_src = fill_UV(img_uv_src)
      tmesh.texture = img_uv_src
      tmesh_rotated.texture = img_uv_src
  
      face = Face(
          tmesh=tmesh,
          tmesh_masked=tmesh_masked,
          tmesh_rotated=tmesh_rotated,
          img_uv_src=img_uv_src,
          angle_uv_src=angle_uv_src,
          angle_uv_list=[],
          img_uv_list=[],
          view_angle_src=view_angle_src,
          id_features=id_features,
          exclude_mask=mask,
          is_profile=is_profile,
          mode=self.mode,
      )
  
      face.angle_uv_list = [
          np.clip(angle_uv_src.pixels * face.coef_dict()["src"], -1, 1)
      ]
      face.img_uv_list = [fill_UV(img_uv_src).pixels]
  
      return face
  
imports: from utils.align2stylegan import align_im2stylegan, align_mesh2stylegan
  from core.projection_handler import Projection_Handler
  from skimage.morphology import remove_small_holes
  import time
  from utils.ganfit_camera import apply_camera_only3d, get_pose
  from utils.utils import *
  from core.arcface_handler import Arcface_Handler
  from utils import generate_heatmap
label_desc: Use image node_id 8 for calling the Operator obj's underlying member method code with example usage: obj.get_tmesh(im, reconstruction_dict, face_mask) and returns: face