code: def rasterize_image(
      mesh,
      img_shape,
      pose_angle_deg=[0, 0, 0],
      cam_dist=7,
  ):
      camera = perspective_camera_for_template(
          img_shape, pose_angle_deg=pose_angle_deg, cam_dist=cam_dist
      )
  
      # Pre-process - align the mesh roughly with the template
      # aligned_mesh = align_mesh_to_template(mesh, template).apply(mesh)
  
      mesh_in_img = camera.apply(mesh)
  
      bcs = rasterize_barycentric_coordinate_images(
          mesh_in_img, img_shape
      )
      img = rasterize_mesh_from_barycentric_coordinate_images(
          mesh_in_img, *bcs
      )
      #   shape_img = rasterize_shape_image_from_barycentric_coordinate_images(mesh, *bcs)
      img.pixels = np.clip(img.pixels, 0.0, 1.0)
      return img, mesh_in_img.points
  
file_path: insightface/reconstruction/ostec/utils/image_rasterization.py
imports: from menpo3d.rasterize import rasterize_barycentric_coordinate_images, rasterize_mesh_from_barycentric_coordinate_images
  from menpo.transform import Rotation, Translation, Scale
  from menpo3d.camera import PerspectiveProjection, PerspectiveCamera
  import numpy
label_desc: Use image node_id 6 for calling a global function with example usage: rasterize_image(mesh, img_shape, pose_angle_deg, cam_dist) and returns: img,  mesh_in_img