class_docstr: `Imagenette <https://github.com/fastai/imagenette#imagenette-1>`_ image classification dataset.
  
  Args:
      root (string): Root directory of the Imagenette dataset.
      split (string, optional): The dataset split. Supports ``"train"`` (default), and ``"val"``.
      size (string, optional): The image size. Supports ``"full"`` (default), ``"320px"``, and ``"160px"``.
      download (bool, optional): If ``True``, downloads the dataset components and places them in ``root``. Already
          downloaded archives are not downloaded again.
      transform (callable, optional): A function/transform that takes in a 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.
  
   Attributes:
      classes (list): List of the class name tuples.
      class_to_idx (dict): Dict with items (class name, class index).
      wnids (list): List of the WordNet IDs.
      wnid_to_idx (dict): Dict with items (WordNet ID, class index).
class_docstr_tok: ["`","Imagenette","<","https",":","\/\/github.com\/fastai\/imagenette","#","imagenette-1",">","`","_","image","classification","dataset",".","Args",":","root","(","string",")",":","Root","directory","of","the","Imagenette","dataset",".","split","(","string",",","optional",")",":","The","dataset","split",".","Supports","``","``","train","''","``","(","default",")",",","and","``","``","val","''","``",".","size","(","string",",","optional",")",":","The","image","size",".","Supports","``","``","full","''","``","(","default",")",",","``","``","320px","''","``",",","and","``","``","160px","''","``",".","download","(","bool",",","optional",")",":","If","``","True","``",",","downloads","the","dataset","components","and","places","them","in","``","root","``",".","Already","downloaded","archives","are","not","downloaded","again",".","transform","(","callable",",","optional",")",":","A","function\/transform","that","takes","in","a","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",".","Attributes",":","classes","(","list",")",":","List","of","the","class","name","tuples",".","class_to_idx","(","dict",")",":","Dict","with","items","(","class","name",",","class","index",")",".","wnids","(","list",")",":","List","of","the","WordNet","IDs",".","wnid_to_idx","(","dict",")",":","Dict","with","items","(","WordNet","ID",",","class","index",")","."]
code: def __init__(
      self,
      root: str,
      split: str = "train",
      size: str = "full",
      download=False,
      transform: Optional[Callable] = None,
      target_transform: Optional[Callable] = None,
  ) -> None:
      super().__init__(
          root, transform=transform, target_transform=target_transform
      )
  
      self._split = verify_str_arg(split, "split", ["train", "val"])
      self._size = verify_str_arg(
          size, "size", ["full", "320px", "160px"]
      )
  
      self._url, self._md5 = self._ARCHIVES[self._size]
      self._size_root = Path(self.root) / Path(self._url).stem
      self._image_root = str(self._size_root / self._split)
  
      if download:
          self._download()
      elif not self._check_exists():
          raise RuntimeError(
              "Dataset not found. You can use download=True to download it."
          )
  
      self.wnids, self.wnid_to_idx = find_classes(self._image_root)
      self.classes = [self._WNID_TO_CLASS[wnid] for wnid in self.wnids]
      self.class_to_idx = {
          class_name: idx
          for wnid, idx in self.wnid_to_idx.items()
          for class_name in self._WNID_TO_CLASS[wnid]
      }
      self._samples = make_dataset(
          self._image_root, self.wnid_to_idx, extensions=".jpeg"
      )
  
file_path: vision/torchvision/datasets/imagenette.py
imports: from pathlib import Path
  from typing import Any, Callable, Optional, Tuple
  from PIL import Image
  from .folder import find_classes, make_dataset
  from .utils import download_and_extract_archive, verify_str_arg
  from .vision import VisionDataset
label_desc: Use image node_id 1 to create a new Imagenette object from inherited base classes: VisionDataset with example: obj = Imagenette(root, split, size, download, transform, target_transform)