code: def __init__(self, root: str, train: bool, transforms=None):
      super(DriveDataset, self).__init__()
      self.flag = "training" if train else "test"
      data_root = os.path.join(root, "DRIVE", self.flag)
      assert os.path.exists(
          data_root
      ), f"path '{data_root}' does not exists."
      self.transforms = transforms
      img_names = [
          i
          for i in os.listdir(os.path.join(data_root, "images"))
          if i.endswith(".tif")
      ]
      self.img_list = [
          os.path.join(data_root, "images", i) for i in img_names
      ]
      self.manual = [
          os.path.join(
              data_root, "1st_manual", i.split("_")[0] + "_manual1.gif"
          )
          for i in img_names
      ]
      # check files
      for i in self.manual:
          if os.path.exists(i) is False:
              raise FileNotFoundError(f"file {i} does not exists.")
  
      self.roi_mask = [
          os.path.join(
              data_root,
              "mask",
              i.split("_")[0] + f"_{self.flag}_mask.gif",
          )
          for i in img_names
      ]
      # check files
      for i in self.roi_mask:
          if os.path.exists(i) is False:
              raise FileNotFoundError(f"file {i} does not exists.")
  
file_path: deep-learning-for-image-processing/pytorch_segmentation/unet/my_dataset.py
imports: import os
  from PIL import Image
  import numpy
  from torch.utils.data import Dataset
label_desc: Use image node_id 1 to create a new DriveDataset object from inherited base classes: Dataset with example: obj = DriveDataset(root, train, transforms)