class_docstr: Simple VisionDataset type for the classification tasks.
  
  The current class expects that data within the root folder
  will be structured the following way:
  
      - root/
          - class1/
              image1.jpeg
  
  Otherwise, exception will be raised.
  
  Parameters
  ----------
  root : str
      Path to the root directory of the dataset.
  transforms : Callable, optional
      A function/transform that takes in an PIL image and returns a transformed version.
      E.g, transforms.RandomCrop
  transform : Callable, optional
      A function/transforms that takes in an image and a label and returns the
      transformed versions of both.
      E.g, ``transforms.Rotate``
  target_transform : Callable, optional
      A function/transform that takes in the target and transforms it.
  image_extension : str, default 'jpg'
      images format
class_docstr_tok: ["Simple","VisionDataset","type","for","the","classification","tasks",".","The","current","class","expects","that","data","within","the","root","folder","will","be","structured","the","following","way",":","-","root\/","-","class1\/","image1.jpeg","Otherwise",",","exception","will","be","raised",".","Parameters","--","--","--","--","--","root",":","str","Path","to","the","root","directory","of","the","dataset",".","transforms",":","Callable",",","optional","A","function\/transform","that","takes","in","an","PIL","image","and","returns","a","transformed","version",".","E.g",",","transforms.RandomCrop","transform",":","Callable",",","optional","A","function\/transforms","that","takes","in","an","image","and","a","label","and","returns","the","transformed","versions","of","both",".","E.g",",","``","transforms.Rotate","``","target_transform",":","Callable",",","optional","A","function\/transform","that","takes","in","the","target","and","transforms","it",".","image_extension",":","str",",","default","'jpg'","images","format"]
code: def __init__(
      self,
      root: str,
      transforms: t.Optional[t.Callable] = None,
      transform: t.Optional[t.Callable] = None,
      target_transform: t.Optional[t.Callable] = None,
      image_extension: str = "jpg",
  ) -> None:
      self.root_path = Path(root).absolute()
  
      if not (self.root_path.exists() and self.root_path.is_dir()):
          raise ValueError(
              f"{self.root_path} - path does not exist or is not a folder"
          )
  
      super().__init__(
          str(self.root_path), transforms, transform, target_transform
      )
      self.image_extension = image_extension.lower()
      self.images = sorted(
          self.root_path.glob(f"*/*.{self.image_extension}")
      )
  
      if len(self.images) == 0:
          raise ValueError(
              f"{self.root_path} - is empty or has incorrect structure"
          )
  
      classes = {img.parent.name for img in self.images}
      classes = sorted(list(classes))
  
      # class label -> class index
      self.classes_map = t.cast(
          t.Dict[str, int], dict(zip(classes, range(len(classes))))
      )
      # class index -> class  label
      self.reverse_classes_map = t.cast(
          t.Dict[int, str], {v: k for k, v in self.classes_map.items()}
      )
  
file_path: deepchecks/deepchecks/vision/vision_data/simple_classification_data.py
imports: import typing
  from pathlib import Path
  import cv2
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from typing_extensions import Literal
  from deepchecks.vision.vision_data import VisionData
label_desc: Use image node_id 1 to create a new SimpleClassificationDataset object from inherited base classes: VisionDataset with example: obj = SimpleClassificationDataset(root, transforms, transform, target_transform, image_extension)