class_docstr: Semantic segmentation dataset for `CamVid`_.
  
  .. _`CamVid`:
      https://github.com/alexgkendall/SegNet-Tutorial/tree/master/CamVid
  
  Args:
      data_dir (string): Path to the root of the training data. If this is
          :obj:`auto`, this class will automatically download data for you
          under :obj:`$CHAINER_DATASET_ROOT/pfnet/chainercv/camvid`.
      split ({'train', 'val', 'test'}): Select from dataset splits used
          in CamVid Dataset.
  
  
  This dataset returns the following data.
  
  .. csv-table::
      :header: name, shape, dtype, format
  
      :obj:`img`, ":math:`(3, H, W)`", :obj:`float32`,         "RGB, :math:`[0, 255]`"
      :obj:`label`, ":math:`(H, W)`", :obj:`int32`,         ":math:`[-1, \#class - 1]`"
class_docstr_tok: ["Semantic","segmentation","dataset","for","`","CamVid","`","_",".","..","_","`","CamVid","`",":","https",":","\/\/github.com\/alexgkendall\/SegNet-Tutorial\/tree\/master\/CamVid","Args",":","data_dir","(","string",")",":","Path","to","the","root","of","the","training","data",".","If","this","is",":","obj",":","`","auto","`",",","this","class","will","automatically","download","data","for","you","under",":","obj",":","`","$","CHAINER_DATASET_ROOT\/pfnet\/chainercv\/camvid","`",".","split","(","{","'train","'",",","'val","'",",","'test","'","}",")",":","Select","from","dataset","splits","used","in","CamVid","Dataset",".","This","dataset","returns","the","following","data",".","..","csv-table",":",":",":","header",":","name",",","shape",",","dtype",",","format",":","obj",":","`","img","`",",","``",":","math",":","`","(","3",",","H",",","W",")","`","``",",",":","obj",":","`","float32","`",",","``","RGB",",",":","math",":","`","[","0",",","255","]","`","``",":","obj",":","`","label","`",",","``",":","math",":","`","(","H",",","W",")","`","``",",",":","obj",":","`","int32","`",",","``",":","math",":","`","[","-1",",","\\","#","class","-","1","]","`","``"]
code: def __init__(self, data_dir="auto", split="train"):
      super(CamVidDataset, self).__init__()
  
      if split not in ["train", "val", "test"]:
          raise ValueError(
              "Please pick split from 'train', 'val', 'test'"
          )
  
      if data_dir == "auto":
          data_dir = get_camvid()
  
      img_list_path = os.path.join(data_dir, "{}.txt".format(split))
      self.paths = [
          [
              os.path.join(data_dir, fn.replace("/SegNet/CamVid/", ""))
              for fn in line.split()
          ]
          for line in open(img_list_path)
      ]
  
      self.add_getter("img", self._get_image)
      self.add_getter("iabel", self._get_label)
  
file_path: chainercv/chainercv/datasets/camvid/camvid_dataset.py
imports: import filelock
  import glob
  import os
  import shutil
  import numpy
  from chainer.dataset import download
  from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
  from chainercv import utils
  from chainercv.utils import read_image
  from chainercv.utils import read_label
label_desc: Use image node_id 1 to create a new CamVidDataset object from inherited base classes: GetterDataset with example: obj = CamVidDataset(data_dir, split)