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()

        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.
        
avalanche/benchmarks/datasets/penn_fudan/penn_fudan_dataset.py