code: def perspective_project(
      vertices, fovy, aspect_ratio=1.0, near=0.1, far=1000.0
  ):
      """perspective projection.
      Args:
          vertices: [nver, 3]
          fovy: vertical angular field of view. degree.
          aspect_ratio : width / height of field of view
          near : depth of near clipping plane
          far : depth of far clipping plane
      Returns:
          projected_vertices: [nver, 3]
      """
      fovy = np.deg2rad(fovy)
      top = near * np.tan(fovy)
      bottom = -top
      right = top * aspect_ratio
      left = -right
  
      # -- homo
      P = np.array(
          [
              [near / right, 0, 0, 0],
              [0, near / top, 0, 0],
              [
                  0,
                  0,
                  -(far + near) / (far - near),
                  -2 * far * near / (far - near),
              ],
              [0, 0, -1, 0],
          ]
      )
      vertices_homo = np.hstack(
          (vertices, np.ones((vertices.shape[0], 1)))
      )  # [nver, 4]
      projected_vertices = vertices_homo.dot(P.T)
      projected_vertices = (
          projected_vertices / projected_vertices[:, 3:]
      )
      projected_vertices = projected_vertices[:, :3]
      projected_vertices[:, 2] = -projected_vertices[:, 2]
  
      # -- non homo. only fovy
      # projected_vertices = vertices.copy()
      # projected_vertices[:,0] = -(near/right)*vertices[:,0]/vertices[:,2]
      # projected_vertices[:,1] = -(near/top)*vertices[:,1]/vertices[:,2]
      return projected_vertices
  
file_path: insightface/python-package/insightface/thirdparty/face3d/mesh/transform.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import math
  from math import cos, sin
label_desc: Use image node_id 8 for calling a global function with example usage: perspective_project(vertices, fovy, aspect_ratio, near, far) and returns: projected_vertices