code: def barycentric_coordinates(p, select_vertices):
      a = select_vertices[:, 0, :]
      b = select_vertices[:, 1, :]
      c = select_vertices[:, 2, :]
      # p = point
  
      v0 = b - a
      v1 = c - a
      v2 = p - a
      d00 = (v0 * v0).sum(axis=1)
      d01 = (v0 * v1).sum(axis=1)
      d11 = (v1 * v1).sum(axis=1)
      d20 = (v2 * v0).sum(axis=1)
      d21 = (v2 * v1).sum(axis=1)
      denom = d00 * d11 - d01 * d01
      v = (d11 * d20 - d01 * d21) / denom
      w = (d00 * d21 - d01 * d20) / denom
      u = 1 - v - w
  
      return np.vstack([u, v, w]).T
  
imports: import torch
  import torch.nn
  import numpy
  import trimesh
  import os
  from utils import rend_util
  from model.embedder import *
  from model.ray_tracing import RayTracing
  from model.sample_network import SampleNetwork
label_desc: Use image node_id 1 for calling a global function with example usage: barycentric_coordinates(p, select_vertices) and returns: np