code: def load_srn_sample(
      path_to_srn: str,
      category: str,
      split: str,
      shape_name: str,
      view_id: int,
  ):
      """Load image and camera parameters from the SRN-ShapeNet dataset.
  
      Args:
          path_to_srn: Full path to the SRN dataset.
          category: Object category (chairs, cars),
          split: Training/validation/testing split.
          shape_name: The name of the shape.
          view_id: The view index of the shape.
  
      Returns:
          A numpy array with the focal length,
          a numpy array with the principal point,
          a numpy array with the rotation matrix,
          a numpy array with the translation vector.
      """
      image_name = os.path.join(
          path_to_srn,
          "{0}_{1}".format(category, split),
          shape_name,
          "rgb",
          "{0:06d}.png".format(view_id),
      )
      with tf.io.gfile.GFile(image_name, "rb") as f:
          image = np.array(Image.open(f), dtype=np.float32) / 255.0
      if image.shape[-1] == 3:
          image = np.dstack(
              [image, np.ones((128, 128, 1), dtype=np.float32)]
          )
      color_sum = np.sum(image[..., :3], axis=-1)
      i, j = (color_sum == 3).nonzero()
      image[i, j, -1] = 0
  
      intrinsics_fname = os.path.join(
          path_to_srn,
          "{0}_{1}".format(category, split),
          shape_name,
          "intrinsics.txt",
      )
      with tf.io.gfile.GFile(intrinsics_fname, "r") as f:
          line = f.readline().replace("\n", "").split(" ")
          intrinsics_info = np.array(line, dtype=np.float32)
          intrinsics = np.eye(3, dtype=np.float32)
          intrinsics[0, 0] = intrinsics_info[0]
          intrinsics[1, 1] = intrinsics_info[0]
          intrinsics[0, 2] = intrinsics_info[1]
          intrinsics[1, 2] = intrinsics_info[2]
  
      extrinsics_fname = os.path.join(
          path_to_srn,
          "{0}_{1}".format(category, split),
          shape_name,
          "pose",
          "{0:06d}.txt".format(view_id),
      )
      with tf.io.gfile.GFile(extrinsics_fname, "r") as f:
          extrinsics = (
              np.loadtxt(f, dtype=float)
              .reshape([4, 4])
              .astype(np.float32)
          )
  
      extrinsics = np.linalg.inv(extrinsics)
      rotation_matrix = extrinsics[:3, :3]
      translation_vector = extrinsics[:3, [3]]
  
      focal = intrinsics[[0, 1], [0, 1]]
      principal_point = intrinsics[[0, 1], [2, 2]]
      return (
          image,
          focal,
          principal_point,
          rotation_matrix,
          translation_vector,
      )
  
file_path: graphics/tensorflow_graphics/projects/radiance_fields/data_loaders.py
imports: import json
  import os
  from typing import Optional
  import numpy
  from PIL import Image
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: load_srn_sample(path_to_srn, category, split, shape_name, view_id) and returns: image,  focal,  principal_point,  rotation_matrix,  translation_vector