code: def project_point(cam, point3d, num_frames):
      """Compute the image space coordinates [0, 1] for a set of points.
  
      Args:
        cam: The camera parameters, as returned by kubric.  'matrix_world' and
          'intrinsics' have a leading axis num_frames.
        point3d: Points in 3D world coordinates.  it has shape [num_frames,
          num_points, 3].
        num_frames: The number of frames in the video.
  
      Returns:
        Image coordinates in 2D.  The last coordinate is an indicator of whether
          the point is behind the camera.
      """
  
      homo_transform = tf.linalg.inv(cam["matrix_world"])
      homo_intrinsics = tf.zeros((num_frames, 3, 1), dtype=tf.float32)
      homo_intrinsics = tf.concat(
          [cam["intrinsics"], homo_intrinsics], axis=2
      )
  
      point4d = tf.concat(
          [point3d, tf.ones_like(point3d[:, :, 0:1])], axis=2
      )
      projected = tf.matmul(
          point4d, tf.transpose(homo_transform, (0, 2, 1))
      )
      projected = tf.matmul(
          projected, tf.transpose(homo_intrinsics, (0, 2, 1))
      )
      image_coords = projected / projected[:, :, 2:3]
      image_coords = tf.concat(
          [image_coords[:, :, :2], tf.sign(projected[:, :, 2:])], axis=2
      )
      return image_coords
  
imports: import functools
  import itertools
  import matplotlib.pyplot
  import mediapy
  import numpy
  import tensorflow.compat.v1
  import tensorflow_datasets
  from tensorflow_graphics.geometry.transformation import rotation_matrix_3d
label_desc: Use image node_id 1 for calling a global function with example usage: project_point(cam, point3d, num_frames) and returns: image_coords