class_docstr: Image-Patch Classification Subsequence Dataset
class_docstr_tok: ["Image-Patch","Classification","Subsequence","Dataset"]
docstr: Dataset containing image-patches and targets for one subsequence of
  an endless continual learning simulator's sequence, that has been
  converted for image-patch classification.
  
  :param file_paths: List that contains the paths to all images files
      that are part of this subsequence.
  :param targets: List that contains the targets (`object category
      names` (str)) for each respective image.
  :param patch_size: Int defining the quadratic patch-size the
      image-patches are resized to.
  :param labelmap_path: Path to a `labelmap.json` file that specifies
      a mapping from `object category names` to labels.
  :param transform: Eventual transformations to be applied to the image
      data.
  :param target_transform: Eventual transformations to be applied to the
      target data.
code: def __init__(
      self,
      file_paths,
      targets,
      patch_size=64,
      labelmap_path=None,
      transform=None,
      target_transform=None,
  ):
      """Dataset containing image-patches and targets for one subsequence of
      an endless continual learning simulator's sequence, that has been
      converted for image-patch classification.
  
      :param file_paths: List that contains the paths to all images files
          that are part of this subsequence.
      :param targets: List that contains the targets (`object category
          names` (str)) for each respective image.
      :param patch_size: Int defining the quadratic patch-size the
          image-patches are resized to.
      :param labelmap_path: Path to a `labelmap.json` file that specifies
          a mapping from `object category names` to labels.
      :param transform: Eventual transformations to be applied to the image
          data.
      :param target_transform: Eventual transformations to be applied to the
          target data.
      """
      self.file_paths = file_paths
      self.targets = targets
      self.patch_size = patch_size
      self.transform = transform
      self.target_transform = target_transform
  
      self.labelmap = self._load_labelmap(labelmap_path)
  
      return
  
imports: from pathlib import Path
  import glob
  import os
  from typing import List, Optional, Union
  from warnings import warn
  import sys
  import json
  import numpy
  from PIL import Image
  from torch.utils.data import Dataset
  from avalanche.benchmarks.datasets import default_dataset_location
  from avalanche.benchmarks.datasets.endless_cl_sim import endless_cl_sim_data
  from avalanche.benchmarks.datasets.downloadable_dataset import DownloadableDataset
label_desc: Use image node_id 1 to create a new ClassificationSubSequence object from inherited base classes: Dataset with example: obj = ClassificationSubSequence(file_paths, targets, patch_size, labelmap_path, transform, target_transform)