code: def vertices2landmarks(
      vertices, faces, lmk_faces_idx, lmk_bary_coords
  ):
      """Calculates landmarks by barycentric interpolation
  
      Parameters
      ----------
      vertices: torch.tensor BxVx3, dtype = torch.float32
          The tensor of input vertices
      faces: torch.tensor Fx3, dtype = torch.long
          The faces of the mesh
      lmk_faces_idx: torch.tensor L, dtype = torch.long
          The tensor with the indices of the faces used to calculate the
          landmarks.
      lmk_bary_coords: torch.tensor Lx3, dtype = torch.float32
          The tensor of barycentric coordinates that are used to interpolate
          the landmarks
  
      Returns
      -------
      landmarks: torch.tensor BxLx3, dtype = torch.float32
          The coordinates of the landmarks for each mesh in the batch
      """
      # Extract the indices of the vertices for each face
      # BxLx3
      batch_size, num_verts = vertices.shape[:2]
      device = vertices.device
  
      lmk_faces = (
          torch.index_select(faces, 0, lmk_faces_idx.view(-1))
          .contiguous()
          .view(batch_size, -1, 3)
      )
  
      lmk_faces = (
          lmk_faces
          + torch.arange(
              batch_size, dtype=torch.long, device=device
          ).view(-1, 1, 1)
          * num_verts
      )
  
      lmk_vertices = (
          vertices.view(-1, 3)
          .contiguous()[lmk_faces]
          .contiguous()
          .view(batch_size, -1, 3, 3)
      )
  
      landmarks = torch.einsum(
          "blfi,blf->bli", [lmk_vertices, lmk_bary_coords]
      )
      return landmarks
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os.path
  import pickle
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 4 for calling a global function with example usage: vertices2landmarks(vertices, faces, lmk_faces_idx, lmk_bary_coords) and returns: landmarks