code: def perspective(aspect_ratio, fov_y, near_clip, far_clip):
      """Computes perspective transformation matrices.
      Functionality mimes gluPerspective (third_party/GL/glu/include/GLU/glu.h).
      Args:
        aspect_ratio: float value specifying the image aspect ratio (width/height).
        fov_y: 1-D float32 Tensor with shape [batch_size] specifying output vertical
            field of views in degrees.
        near_clip: 1-D float32 Tensor with shape [batch_size] specifying near
            clipping plane distance.
        far_clip: 1-D float32 Tensor with shape [batch_size] specifying far clipping
            plane distance.
      Returns:
        A [batch_size, 4, 4] float tensor that maps from right-handed points in eye
        space to left-handed points in clip space.
      """
      focal_lengths_y = 1.0 / np.tan(fov_y * (math.pi / 360.0))
      depth_range = far_clip - near_clip
      p_22 = -(far_clip + near_clip) / depth_range
      p_23 = -2.0 * (far_clip * near_clip / depth_range)
  
      zeros = np.zeros_like(p_23, dtype=np.float32)
      # pyformat: disable
      perspective_transform = np.concatenate(
          [
              focal_lengths_y / aspect_ratio,
              zeros,
              zeros,
              zeros,
              zeros,
              focal_lengths_y,
              zeros,
              zeros,
              zeros,
              zeros,
              p_22,
              p_23,
              zeros,
              zeros,
              -np.ones_like(p_23, dtype=np.float32),
              zeros,
          ],
          axis=0,
      )
      # pyformat: enable
      perspective_transform = np.reshape(
          perspective_transform, [4, 4, -1]
      )
      return np.transpose(perspective_transform, [2, 0, 1])
  
file_path: insightface/reconstruction/ostec/utils/ganfit_camera.py
imports: import numpy
  import math
label_desc: Use image node_id 2 for calling a global function with example usage: perspective(aspect_ratio, fov_y, near_clip, far_clip) and returns: np