class_docstr: A generic data loader where the images are arranged in this way: ::
      root/dog/xxx.png
      root/dog/xxy.png
      root/dog/[...]/xxz.png
      root/cat/123.png
      root/cat/nsdf3.png
      root/cat/[...]/asd932_.png
  Args:
      root (string): Root directory path.
      transform (callable, optional): A function/transform that  takes in an PIL image
          and returns a transformed version. E.g, ``transforms.RandomCrop``
      target_transform (callable, optional): A function/transform that takes in the
          target and transforms it.
      loader (callable, optional): A function to load an image given its path.
      is_valid_file (callable, optional): A function that takes path of an Image file
          and check if the file is a valid file (used to check of corrupt files)
   Attributes:
      classes (list): List of the class names sorted alphabetically.
      class_to_idx (dict): Dict with items (class_name, class_index).
      imgs (list): List of (image path, class_index) tuples
code: def __init__(
      self,
      root: str,
      transform: Optional[Callable] = None,
      target_transform: Optional[Callable] = None,
      classes_fraction=1.0,
      data_per_class_fraction=1.0,
      loader: Callable[[str], Any] = default_loader,
      is_valid_file: Optional[Callable[[str], bool]] = None,
  ):
      super(ImageFolder, self).__init__(
          root,
          loader,
          IMG_EXTENSIONS if is_valid_file is None else None,
          transform=transform,
          target_transform=target_transform,
          classes_fraction=classes_fraction,
          data_per_class_fraction=data_per_class_fraction,
          is_valid_file=is_valid_file,
      )
      self.imgs = self.samples
  
imports: from torchvision.datasets import VisionDataset
  from PIL import Image
  import os
  import os.path
  from typing import Any, Callable, cast, Dict, List, Optional, Tuple
  import numpy
label_desc: Use image node_id 1 to create a new ImageFolder object from inherited base classes: DatasetFolder with example: obj = ImageFolder(root, transform, target_transform, classes_fraction, data_per_class_fraction, loader, is_valid_file)