class_docstr: The Penn-Fudan Pedestrian detection and segmentation dataset
  
  Adapted from the "TorchVision Object Detection Finetuning Tutorial":
  https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
docstr: Creates an instance of the Penn-Fudan dataset.
  
  :param root: The directory where the dataset can be found or downloaded.
      Defaults to None, which means that the default location for
      "pennfudanped" will be used.
  :param transform: The transformation to apply to (img, annotations)
      values.
  :param loader: The image loader to use.
  :param mask_loader: The mask image loader to use.
  :param download: If True, the dataset will be downloaded if needed.
docstr_tok: ["Creates","an","instance","of","the","Penn-Fudan","dataset",".",":","param","root",":","The","directory","where","the","dataset","can","be","found","or","downloaded",".","Defaults","to","None",",","which","means","that","the","default","location","for","``","pennfudanped","''","will","be","used",".",":","param","transform",":","The","transformation","to","apply","to","(","img",",","annotations",")","values",".",":","param","loader",":","The","image","loader","to","use",".",":","param","mask_loader",":","The","mask","image","loader","to","use",".",":","param","download",":","If","True",",","the","dataset","will","be","downloaded","if","needed","."]
code: def __init__(
      self,
      root: Optional[Union[str, Path]] = None,
      *,
      transform=None,
      loader=default_loader,
      mask_loader=default_mask_loader,
      download=True,
  ):
      """
      Creates an instance of the Penn-Fudan dataset.
  
      :param root: The directory where the dataset can be found or downloaded.
          Defaults to None, which means that the default location for
          "pennfudanped" will be used.
      :param transform: The transformation to apply to (img, annotations)
          values.
      :param loader: The image loader to use.
      :param mask_loader: The mask image loader to use.
      :param download: If True, the dataset will be downloaded if needed.
      """
  
      if root is None:
          root = default_dataset_location("pennfudanped")
  
      self.imgs: Sequence[Path] = None  # type: ignore
      self.masks: Sequence[Path] = None  # type: ignore
      self.targets: List[Dict] = None  # type: ignore
      self.transform = transform
      self.loader = loader
      self.mask_loader = mask_loader
  
      super().__init__(
          root,
          penn_fudan_data[0],
          penn_fudan_data[1],
          download=download,
          verbose=True,
      )
  
      self._load_dataset()
  
file_path: avalanche/avalanche/benchmarks/datasets/penn_fudan/penn_fudan_dataset.py
imports: from pathlib import Path
  from typing import Dict, List, Optional, Sequence, Union
  import numpy
  import torch
  from PIL import Image
  from torchvision.datasets.folder import default_loader
  from avalanche.benchmarks.datasets import SimpleDownloadableDataset, default_dataset_location
  from avalanche.benchmarks.datasets.penn_fudan.penn_fudan_data import penn_fudan_data
label_desc: Use image node_id 1 to create a new PennFudanDataset object from inherited base classes: SimpleDownloadableDataset with example: obj = PennFudanDataset(root)