class_docstr: CORe50 Pytorch Dataset
class_docstr_tok: ["CORe50","Pytorch","Dataset"]
docstr: Creates an instance of the CORe50 dataset.
  
  :param root: root for the datasets data. Defaults to None, which
      means that the default location for 'core50' will be used.
  :param train: train or test split.
  :param transform: eventual transformations to be applied.
  :param target_transform: eventual transformation to be applied to the
      targets.
  :param loader: the procedure to load the instance from the storage.
  :param download: boolean to automatically download data. Default to
      True.
  :param mini: boolean to use the 32x32 version instead of the 128x128.
      Default to False.
  :param object_level: if the classification is objects based or
      category based: 50 or 10 way classification problem. Default to True
      (50-way object classification problem)
docstr_tok: ["Creates","an","instance","of","the","CORe50","dataset",".",":","param","root",":","root","for","the","datasets","data",".","Defaults","to","None",",","which","means","that","the","default","location","for","'core50","'","will","be","used",".",":","param","train",":","train","or","test","split",".",":","param","transform",":","eventual","transformations","to","be","applied",".",":","param","target_transform",":","eventual","transformation","to","be","applied","to","the","targets",".",":","param","loader",":","the","procedure","to","load","the","instance","from","the","storage",".",":","param","download",":","boolean","to","automatically","download","data",".","Default","to","True",".",":","param","mini",":","boolean","to","use","the","32x32","version","instead","of","the","128x128",".","Default","to","False",".",":","param","object_level",":","if","the","classification","is","objects","based","or","category","based",":","50","or","10","way","classification","problem",".","Default","to","True","(","50-way","object","classification","problem",")"]
code: def __init__(
      self,
      root: Optional[Union[str, Path]] = None,
      *,
      train=True,
      transform=None,
      target_transform=None,
      loader=default_loader,
      download=True,
      mini=False,
      object_level=True,
  ):
      """Creates an instance of the CORe50 dataset.
  
      :param root: root for the datasets data. Defaults to None, which
          means that the default location for 'core50' will be used.
      :param train: train or test split.
      :param transform: eventual transformations to be applied.
      :param target_transform: eventual transformation to be applied to the
          targets.
      :param loader: the procedure to load the instance from the storage.
      :param download: boolean to automatically download data. Default to
          True.
      :param mini: boolean to use the 32x32 version instead of the 128x128.
          Default to False.
      :param object_level: if the classification is objects based or
          category based: 50 or 10 way classification problem. Default to True
          (50-way object classification problem)
      """
  
      if root is None:
          root = default_dataset_location("core50")
  
      super(CORe50Dataset, self).__init__(
          root, download=download, verbose=True
      )
  
      self.train = train  # training set or test set
      self.transform = transform
      self.target_transform = target_transform
      self.loader = loader
      self.object_level = object_level
      self.mini = mini
  
      # any scenario and run is good here since we want just to load the
      # train images and targets with no particular order
      self._scen = "ni"
      self._run = 0
      self._nbatch = 8
  
      # Download the dataset and initialize metadata
      self._load_dataset()
  
imports: import glob
  import os
  import pickle
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  from warnings import warn
  from torchvision.datasets.folder import default_loader
  from torchvision.transforms import ToTensor
  from avalanche.benchmarks.datasets.core50 import core50_data
  from avalanche.benchmarks.datasets import default_dataset_location
  from avalanche.benchmarks.datasets.downloadable_dataset import DownloadableDataset
label_desc: Use image node_id 1 to create a new CORe50Dataset object from inherited base classes: DownloadableDataset with example: obj = CORe50Dataset(root)