code: def get_uv_mask(vertices_vis, triangles, uv_coords, h, w, resolution):
      triangles = triangles.T
      vertices_vis = vertices_vis.astype(np.float32)
      uv_mask = render_texture(
          uv_coords.T,
          vertices_vis[np.newaxis, :],
          triangles,
          resolution,
          resolution,
          1,
      )
      uv_mask = np.squeeze(uv_mask > 0)
      uv_mask = ndimage.binary_closing(uv_mask)
      uv_mask = ndimage.binary_erosion(
          uv_mask, structure=np.ones((4, 4))
      )
      uv_mask = ndimage.binary_closing(uv_mask)
      uv_mask = ndimage.binary_erosion(
          uv_mask, structure=np.ones((4, 4))
      )
      uv_mask = ndimage.binary_erosion(
          uv_mask, structure=np.ones((4, 4))
      )
      uv_mask = ndimage.binary_erosion(
          uv_mask, structure=np.ones((4, 4))
      )
      uv_mask = uv_mask.astype(np.float32)
  
      return np.squeeze(uv_mask)
  
imports: import numpy
  from scipy import ndimage
  from utils.render import render_texture
  from utils.render import vis_of_vertices
label_desc: Use image node_id 2 for calling a global function with example usage: get_uv_mask(vertices_vis, triangles, uv_coords, h, w, resolution) and returns: np