code: def look_at(eye, center, world_up):
      """Computes camera viewing matrices.
      Functionality mimes gluLookAt (third_party/GL/glu/include/GLU/glu.h).
      Args:
      eye: 2-D float32 tensor with shape [batch_size, 3] containing the XYZ world
          space position of the camera.
      center: 2-D float32 tensor with shape [batch_size, 3] containing a position
          along the center of the camera's gaze.
      world_up: 2-D float32 tensor with shape [batch_size, 3] specifying the
          world's up direction; the output camera will have no tilt with respect
          to this direction.
      Returns:
      A [batch_size, 4, 4] float tensor containing a right-handed camera
      extrinsics matrix that maps points from world space to points in eye space.
      """
      batch_size = center.shape[0]
      vector_degeneracy_cutoff = 1e-6
      forward = center - eye
      forward_norm = np.linalg.norm(forward, axis=1, keepdims=True)
      forward = np.divide(forward, forward_norm)
  
      to_side = np.cross(forward, world_up)
      to_side_norm = np.linalg.norm(to_side, axis=1, keepdims=True)
      to_side = np.divide(to_side, to_side_norm)
      cam_up = np.cross(to_side, forward)
  
      w_column = np.array(
          batch_size * [[0.0, 0.0, 0.0, 1.0]], dtype=np.float32
      )  # [batch_size, 4]
      w_column = np.reshape(w_column, [batch_size, 4, 1])
      view_rotation = np.stack(
          [
              to_side,
              cam_up,
              -forward,
              np.zeros_like(to_side, dtype=np.float32),
          ],
          axis=1,
      )  # [batch_size, 4, 3] matrix
      view_rotation = np.concatenate(
          [view_rotation, w_column], axis=2
      )  # [batch_size, 4, 4]
  
      identity_batch = np.tile(
          np.expand_dims(np.eye(3), 0), [batch_size, 1, 1]
      )
      view_translation = np.concatenate(
          [identity_batch, np.expand_dims(-eye, 2)], 2
      )
      view_translation = np.concatenate(
          [view_translation, np.reshape(w_column, [batch_size, 1, 4])],
          1,
      )
      camera_matrices = np.matmul(view_rotation, view_translation)
      return camera_matrices
  
file_path: insightface/reconstruction/ostec/utils/ganfit_camera.py
imports: import numpy
  import math
label_desc: Use image node_id 1 for calling a global function with example usage: look_at(eye, center, world_up) and returns: camera_matrices