code: def load_srn_dataset(
      tfrecords_dir: str,
      batch_size: int = 5,
      seed: Optional[int] = None,
      buffer_size: int = 0,
      drop_remainder: bool = True,
  ):
      """Loads the srn dataset stored in tfrecords.
  
      Args:
          tfrecords_dir: The full path to the directory containing the tf-records.
          batch_size: Batch size for the tf dataset.
          seed: Random number generator seed.
          buffer_size: Buffer size for shuffling the dataset.
          drop_remainder: Whether the last batch should be dropped.
  
      Returns:
          A tf.data.Dataset containing the images and camera parameters.
      """
      tfrecords_pattern = tfrecords_dir + "/*.tfrecord"
      dataset = tf.data.Dataset.list_files(
          tfrecords_pattern, shuffle=True, seed=seed
      )
      dataset = dataset.interleave(
          tf.data.TFRecordDataset, cycle_length=16
      )
      if buffer_size > 0:
          dataset = dataset.shuffle(buffer_size=buffer_size, seed=seed)
      dataset = dataset.map(get_srn_sample_proto)
      dataset = dataset.batch(batch_size, drop_remainder)
      return dataset
  
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 8 for calling a global function with example usage: load_srn_dataset(tfrecords_dir, batch_size, seed, buffer_size, drop_remainder) and returns: dataset