code: def transform_homogeneous(matrices, vertices):
      """Applies batched 4x4 homogenous matrix transformations to 3-D vertices.
      The vertices are input and output as as row-major, but are interpreted as
      column vectors multiplied on the right-hand side of the matrices. More
      explicitly, this function computes (MV^T)^T.
      Vertices are assumed to be xyz, and are extended to xyzw with w=1.
      Args:
        matrices: a [batch_size, 4, 4] tensor of matrices.
        vertices: a [batch_size, N, 3] tensor of xyz vertices.
      Returns:
        a [batch_size, N, 4] tensor of xyzw vertices.
      Raises:
        ValueError: if matrices or vertices have the wrong number of dimensions.
      """
      homogeneous_coord = np.ones(
          [np.shape(vertices)[0], np.shape(vertices)[1], 1],
          dtype=np.float32,
      )
      vertices_homogeneous = np.concatenate(
          [vertices, homogeneous_coord], 2
      )
  
      return np.matmul(vertices_homogeneous[0], matrices[0].T)
  
file_path: insightface/reconstruction/ostec/utils/ganfit_camera.py
imports: import numpy
  import math
label_desc: Use image node_id 4 for calling a global function with example usage: transform_homogeneous(matrices, vertices) and returns: np