class_docstr: `ARKitScenes Dataset class.
  
  Args:
      root (string): Root directory of dataset where directory
          exists or will be saved to if download is set to True.
      transform (callable, optional): A function that takes in a sample (dict)
          and returns a transformed version.
      download (bool, optional): If true, downloads the dataset from the internet and
          puts on the root directory. If dataset is already downloaded, it is not
          downloaded again.
code: def __init__(
      self,
      root: str,
      split: str = "train",
      transform: Optional[Callable] = None,
      upsample_factor: Optional[int] = None,
  ) -> None:
      super(ARKitScenesDataset, self).__init__()
      self.root = os.path.expanduser(root)
      self.split = split
      self.transform = transform
      self.upsample_factor = upsample_factor
  
      if (
          self.upsample_factor is not None
          and self.upsample_factor not in (2, 4, 8)
      ):
          raise ValueError(
              f"rgb_factor must to be one of (2,4,8) but got {self.upsample_factor}"
          )
      if split == "train":
          self.split_folder = "Training"
      elif split == "val":
          self.split_folder = "Validation"
      else:
          raise Exception(
              f"split must to be one of (train, val), got ={split}"
          )
      self.dataset_folder = os.path.join(self.root, self.split_folder)
      if self.upsample_factor is None:
          self.low_res = LOW_RES
          self.high_res = HIGH_RES
      else:
          if self.upsample_factor in (2, 4):
              self.low_res = LOW_RES
              self.high_res = [
                  i * self.upsample_factor for i in LOW_RES
              ]
          elif self.upsample_factor == 8:
              self.high_res = HIGH_RES
              self.low_res = [
                  int(i / self.upsample_factor) for i in HIGH_RES
              ]
          else:
              raise Exception(
                  f"Can't load dataset with upsample_factor = {self.upsample_factor}"
              )
  
      self.samples = []  # videos_id, sample_id, sky_direction
      self.meta_data = pd.read_csv(
          os.path.join(
              os.path.dirname(self.dataset_folder), META_DATA_CSV_FILE
          )
      )
      self.meta_data = self.meta_data[
          self.meta_data["fold"] == self.split_folder
      ]
      for video_id, sky_direction in zip(
          self.meta_data["video_id"], self.meta_data["sky_direction"]
      ):
          video_folder = os.path.join(
              self.dataset_folder, str(video_id)
          )
          color_files = glob(os.path.join(video_folder, WIDE, "*.png"))
          self.samples.extend(
              [
                  [
                      str(video_id),
                      str(os.path.basename(file)),
                      sky_direction,
                  ]
                  for file in color_files
              ]
          )
  
file_path: ARKitScenes/depth_upsampling/dataset.py
imports: import os
  from glob import glob
  from typing import Callable, Optional
  import cv2
  import numpy
  import pandas
  from torch.utils.data import Dataset
  import dataset_keys
  from data_utils import image_hwc_to_chw, expand_channel_dim
label_desc: Use image node_id 1 to create a new ARKitScenesDataset object from inherited base classes: Dataset with example: obj = ARKitScenesDataset(root, split, transform, upsample_factor)