class_docstr: Data loader for videos.
class_docstr_tok: ["Data","loader","for","videos","."]
code: def __init__(
      self,
      data_dir,
      image_scale: int,
      shuffle_pixels=False,
      camera_type="json",
      test_camera_trajectory="orbit-extreme",
      **kwargs,
  ):
      self.data_dir = gpath.GPath(data_dir)
      # Load IDs from JSON if it exists. This is useful since COLMAP fails on
      # some images so this gives us the ability to skip invalid images.
      train_ids, val_ids = _load_dataset_ids(self.data_dir)
      super().__init__(train_ids=train_ids, val_ids=val_ids, **kwargs)
      (
          self.scene_center,
          self.scene_scale,
          self._near,
          self._far,
      ) = load_scene_info(self.data_dir)
      self.test_camera_trajectory = test_camera_trajectory
  
      self.image_scale = image_scale
      self.shuffle_pixels = shuffle_pixels
  
      self.rgb_dir = gpath.GPath(data_dir, "rgb", f"{image_scale}x")
      self.depth_dir = gpath.GPath(data_dir, "depth", f"{image_scale}x")
      self.camera_type = camera_type
      self.camera_dir = gpath.GPath(data_dir, "camera")
  
      metadata_path = self.data_dir / "metadata.json"
      self.metadata_dict = None
      if metadata_path.exists():
          with metadata_path.open("r") as f:
              self.metadata_dict = json.load(f)
  
imports: import json
  from typing import List, Tuple
  from absl import logging
  import cv2
  import numpy
  from nerfies import gpath
  from nerfies import types
  from nerfies import utils
  from nerfies.datasets import core
label_desc: Use image node_id 1 to create a new NerfiesDataSource object from inherited base classes: core with example: obj = NerfiesDataSource(data_dir, image_scale, shuffle_pixels, camera_type, test_camera_trajectory)