code: def __init__(self, cfg, dataset_name="train"):
      super().__init__()
      self.cfg = cfg
      self.dataset_name = dataset_name
  
      self.base_path = os.path.join(
          SHAPENET_DATASET_ROOT,
          "srn_{}/srn_{}/{}_{}".format(
              cfg.data.category,
              cfg.data.category,
              cfg.data.category,
              dataset_name,
          ),
      )
  
      is_chair = "chair" in cfg.data.category
      if is_chair and dataset_name == "train":
          # Ugly thing from SRN's public dataset
          tmp = os.path.join(self.base_path, "chairs_2.0_train")
          if os.path.exists(tmp):
              self.base_path = tmp
  
      self.intrins = sorted(
          glob.glob(os.path.join(self.base_path, "*", "intrinsics.txt"))
      )
      if cfg.data.subset != -1:
          self.intrins = self.intrins[: cfg.data.subset]
  
      self.projection_matrix = getProjectionMatrix(
          znear=self.cfg.data.znear,
          zfar=self.cfg.data.zfar,
          fovX=cfg.data.fov * 2 * np.pi / 360,
          fovY=cfg.data.fov * 2 * np.pi / 360,
      ).transpose(0, 1)
  
      self.imgs_per_obj = self.cfg.opt.imgs_per_obj
  
      # in deterministic version the number of testing images
      # and number of training images are the same
      if self.cfg.data.input_images == 1:
          self.test_input_idxs = [64]
      elif self.cfg.data.input_images == 2:
          self.test_input_idxs = [64, 128]
      else:
          raise NotImplementedError
  
file_path: splatter-image/scene/srn.py
imports: import glob
  import os
  import numpy
  import torch
  from torch.utils.data import Dataset
  from .dataset_readers import readCamerasFromTxt
  from utils.general_utils import PILtoTorch, matrix_to_quaternion
  from utils.graphics_utils import getWorld2View2, getProjectionMatrix, getView2World
label_desc: Use image node_id 1 to create a new SRNDataset object from inherited base classes: Dataset with example: obj = SRNDataset(cfg, dataset_name)