class_docstr: A label dataset whose label names are the names of the subdirectories.
  
  The label names are the names of the directories that locate a layer below
  the root directory.
  All images locating under the subdirectoies will be categorized to classes
  with subdirectory names.
  An image is parsed only when the function :obj:`check_img_file`
  returns :obj:`True` by taking the path to the image as an argument.
  If :obj:`check_img_file` is :obj:`None`,
  the path with any image extensions will be parsed.
  
  Example:
  
      A directory structure should be one like below.
  
      .. code::
  
          root
          |-- class_0
          |   |-- img_0.png
          |   |-- img_1.png
          |
          --- class_1
              |-- img_0.png
  
      >>> from chainercv.datasets import DirectoryParsingLabelDataset
      >>> dataset = DirectoryParsingLabelDataset('root')
      >>> dataset.img_paths
      ['root/class_0/img_0.png', 'root/class_0/img_1.png',
      'root_class_1/img_0.png']
      >>> dataset.labels
      array([0, 0, 1])
  
  Args:
      root (string): The root directory.
      check_img_file (callable): A function to determine
          if a file should be included in the dataset.
      color (bool): If :obj:`True`, this dataset read images
          as color images. The default value is :obj:`True`.
      numerical_sort (bool): Label names are sorted numerically.
          This means that label :obj:`2` is before label :obj:`10`,
          which is not the case when string sort is used.
          Regardless of this option, string sort is used for the
          order of files with the same label.
          The default value is :obj:`False`.
  
  This dataset returns the following data.
  
  .. csv-table::
      :header: name, shape, dtype, format
  
      :obj:`img`, ":math:`(3, H, W)` [#directory_parsing_1]_",         :obj:`float32`, "RGB, :math:`[0, 255]`"
      :obj:`label`, scalar, :obj:`int32`, ":math:`[0, \#class - 1]`"
  
  .. [#directory_parsing_1] :math:`(1, H, W)` if :obj:`color = False`.
class_docstr_tok: ["A","label","dataset","whose","label","names","are","the","names","of","the","subdirectories",".","The","label","names","are","the","names","of","the","directories","that","locate","a","layer","below","the","root","directory",".","All","images","locating","under","the","subdirectoies","will","be","categorized","to","classes","with","subdirectory","names",".","An","image","is","parsed","only","when","the","function",":","obj",":","`","check_img_file","`","returns",":","obj",":","`","True","`","by","taking","the","path","to","the","image","as","an","argument",".","If",":","obj",":","`","check_img_file","`","is",":","obj",":","`","None","`",",","the","path","with","any","image","extensions","will","be","parsed",".","Example",":","A","directory","structure","should","be","one","like","below",".","..","code",":",":","root","|","--","class_0","|","|","--","img_0.png","|","|","--","img_1.png","|","--","-","class_1","|","--","img_0.png",">",">",">","from","chainercv.datasets","import","DirectoryParsingLabelDataset",">",">",">","dataset","=","DirectoryParsingLabelDataset","(","'root","'",")",">",">",">","dataset.img_paths","[","'root\/class_0\/img_0.png","'",",","'root\/class_0\/img_1.png","'",",","'root_class_1\/img_0.png","'","]",">",">",">","dataset.labels","array","(","[","0",",","0",",","1","]",")","Args",":","root","(","string",")",":","The","root","directory",".","check_img_file","(","callable",")",":","A","function","to","determine","if","a","file","should","be","included","in","the","dataset",".","color","(","bool",")",":","If",":","obj",":","`","True","`",",","this","dataset","read","images","as","color","images",".","The","default","value","is",":","obj",":","`","True","`",".","numerical_sort","(","bool",")",":","Label","names","are","sorted","numerically",".","This","means","that","label",":","obj",":","`","2","`","is","before","label",":","obj",":","`","10","`",",","which","is","not","the","case","when","string","sort","is","used",".","Regardless","of","this","option",",","string","sort","is","used","for","the","order","of","files","with","the","same","label",".","The","default","value","is",":","obj",":","`","False","`",".","This","dataset","returns","the","following","data",".","..","csv-table",":",":",":","header",":","name",",","shape",",","dtype",",","format",":","obj",":","`","img","`",",","``",":","math",":","`","(","3",",","H",",","W",")","`","[","#","directory_parsing_1","]","_","''",",",":","obj",":","`","float32","`",",","``","RGB",",",":","math",":","`","[","0",",","255","]","`","``",":","obj",":","`","label","`",",","scalar",",",":","obj",":","`","int32","`",",","``",":","math",":","`","[","0",",","\\","#","class","-","1","]","`","``","..","[","#","directory_parsing_1","]",":","math",":","`","(","1",",","H",",","W",")","`","if",":","obj",":","`","color","=","False","`","."]
code: def __len__(self):
      return len(self.img_paths)
  
file_path: chainercv/chainercv/datasets/directory_parsing_label_dataset.py
imports: import numpy
  import os
  from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
  from chainercv.utils import read_image
label_desc: Use image node_id 2 for calling the DirectoryParsingLabelDataset obj's underlying member method code with example usage: obj.__len__() and returns: len