code: def unproject(coord, cam, depth):
      """Unproject points.
  
      Args:
        coord: Points in 2D coordinates.  it has shape [num_points, 2].  Coord is in
          integer (y,x) because of the way meshgrid happens.
        cam: The camera parameters, as returned by kubric.  'matrix_world' and
          'intrinsics' have a leading axis num_frames.
        depth: Depth map for the scene.
  
      Returns:
        Image coordinates in 3D.
      """
      shp = tf.convert_to_tensor(tf.shape(depth))
      idx = coord[:, 0] * shp[1] + coord[:, 1]
      coord = tf.cast(coord[..., ::-1], tf.float32)
      shp = tf.cast(shp[1::-1], tf.float32)[tf.newaxis, ...]
  
      # Need to convert from pixel to raster coordinate.
      projected_pt = (coord + 0.5) / shp
  
      projected_pt = tf.concat(
          [
              projected_pt,
              tf.ones_like(projected_pt[:, -1:]),
          ],
          axis=-1,
      )
  
      camera_plane = projected_pt @ tf.linalg.inv(
          tf.transpose(cam["intrinsics"])
      )
      camera_ball = camera_plane / tf.sqrt(
          tf.reduce_sum(
              tf.square(camera_plane),
              axis=1,
              keepdims=True,
          ),
      )
      camera_ball *= tf.gather(tf.reshape(depth, [-1]), idx)[
          :, tf.newaxis
      ]
  
      camera_ball = tf.concat(
          [
              camera_ball,
              tf.ones_like(camera_plane[:, 2:]),
          ],
          axis=1,
      )
      points_3d = camera_ball @ tf.transpose(cam["matrix_world"])
      return points_3d[:, :3] / points_3d[:, 3:]
  
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 2 for calling a global function with example usage: unproject(coord, cam, depth) and returns: unknown