class_docstr: The PlantsMargin dataset 
class_docstr_tok: ["The","PlantsMargin","dataset"]
docstr: One-hundred plant species leaves dataset (Class = Margin) [1], [2], [3]
  open-ml-id: 1491
  https://archive.ics.uci.edu/ml/datasets/One-hundred+plant+species+leaves+data+set) - 2010
  
  
     (a) Original owners of colour Leaves Samples:
  
   James Cope, Thibaut Beghin, Paolo Remagnino, Sarah Barman.
   The colour images are not included.
   The Leaves were collected in the Royal Botanic Gardens, Kew, UK.
   email: james.cope@kingston.ac.uk
  
     (b) This dataset consists of work carried out by James Cope, Charles Mallah, and James Orwell.
   Donor of database Charles Mallah: charles.mallah@kingston.ac.uk; James Cope:  james.cope@kingston.ac.uk
  
  The original data directory contains the binary images (masks) of the leaf samples (colour images not included).
  There are three features for each image: Shape, Margin and Texture.
  For each feature, a 64 element vector is given per leaf sample.
  These vectors are taken as a contiguous descriptor (for shape) or histograms (for texture and margin).
  So, there are three different files, one for each feature problem:
   * 'data_Sha_64.txt' -> prediction based on shape
   * 'data_Tex_64.txt' -> prediction based on texture
   * 'data_Mar_64.txt' -> prediction based on margin [dataset provided here]
  
  Each row has a 64-element feature vector followed by the Class label.
  There is a total of 1600 samples with 16 samples per leaf class (100 classes), and no missing values.
  
  Three 64 element feature vectors per sample.
  
  Parameters
  ----------
  root : string
      Root directory where the dataset folder `one_hundred_plants_margin` exists.
  
  num_classes_per_task : int
      Number of classes per tasks. This corresponds to "N" in "N-way"
      classification.
  
  meta_train : bool (default: `False`)
      Use the meta-train split of the dataset. If set to `True`, then the
      arguments `meta_val` and `meta_test` must be set to `False`. Exactly one
      of these three arguments must be set to `True`.
  
  meta_val : bool (default: `False`)
      Use the meta-validation split of the dataset. If set to `True`, then the
      arguments `meta_train` and `meta_test` must be set to `False`. Exactly
      one of these three arguments must be set to `True`.
  
  meta_test : bool (default: `False`)
      Use the meta-test split of the dataset. If set to `True`, then the
      arguments `meta_train` and `meta_val` must be set to `False`. Exactly
      one of these three arguments must be set to `True`.
  
  meta_split : string in {'train', 'val', 'test'}, optional
      Name of the split to use. This overrides the arguments `meta_train`,
      `meta_val` and `meta_test` if all three are set to `False`.
  
  transform : callable, optional
      A function/transform that takes a numpy array or a pytorch array
      (depending when the transforms is applied), and returns a transformed
      version.
  
  target_transform : callable, optional
      A function/transform that takes a target, and returns a transformed
      version.
  
  dataset_transform : callable, optional
      A function/transform that takes a dataset (ie. a task), and returns a
      transformed version of it. E.g. `torchmeta.transforms.ClassSplitter()`.
  
  class_augmentations : list of callable, optional
      A list of functions that augment the dataset with new classes. These
      classes are transformations of existing classes.
  
  download : bool (default: `False`)
      If `True`, downloads the original files and processes the dataset in the
      root directory (under the `one_hundred_plants_margin' folder). If the dataset
      is already available, this does not download/process the dataset again.
  
  process_features : bool (default: `False`)
      If `True`, normalizes each feature f with (f-lower) / (upper - lower) where upper
      and lower are the min and max values of feature f of the meta-train dataset.
  
  References
  -----
  [1] Charles Mallah, James Cope, James Orwell.
  Plant Leaf Classification Using Probabilistic Integration of Shape, Texture and Margin Features.
  Signal Processing, Pattern Recognition and Applications, in press.
  
  [2] J. Cope, P. Remagnino, S. Barman, and P. Wilkin.
  Plant texture classification using gabor co-occurrences.
  Advances in Visual Computing, pages 699-677, 2010.
  
  [3] T. Beghin, J. Cope, P. Remagnino, and S. Barman.
  Shape and texture based plant leaf classification.
  In: Advanced Concepts for Intelligent Vision Systems, pages 345-353. Springer, 2010.
docstr_tok: ["One-hundred","plant","species","leaves","dataset","(","Class","=","Margin",")","[","1","]",",","[","2","]",",","[","3","]","open-ml-id",":","1491","https",":","\/\/archive.ics.uci.edu\/ml\/datasets\/One-hundred+plant+species+leaves+data+set",")","-","2010","(","a",")","Original","owners","of","colour","Leaves","Samples",":","James","Cope",",","Thibaut","Beghin",",","Paolo","Remagnino",",","Sarah","Barman",".","The","colour","images","are","not","included",".","The","Leaves","were","collected","in","the","Royal","Botanic","Gardens",",","Kew",",","UK",".","email",":","james.cope","@","kingston.ac.uk","(","b",")","This","dataset","consists","of","work","carried","out","by","James","Cope",",","Charles","Mallah",",","and","James","Orwell",".","Donor","of","database","Charles","Mallah",":","charles.mallah","@","kingston.ac.uk",";","James","Cope",":","james.cope","@","kingston.ac.uk","The","original","data","directory","contains","the","binary","images","(","masks",")","of","the","leaf","samples","(","colour","images","not","included",")",".","There","are","three","features","for","each","image",":","Shape",",","Margin","and","Texture",".","For","each","feature",",","a","64","element","vector","is","given","per","leaf","sample",".","These","vectors","are","taken","as","a","contiguous","descriptor","(","for","shape",")","or","histograms","(","for","texture","and","margin",")",".","So",",","there","are","three","different","files",",","one","for","each","feature","problem",":","*","'data_Sha_64.txt","'","-",">","prediction","based","on","shape","*","'data_Tex_64.txt","'","-",">","prediction","based","on","texture","*","'data_Mar_64.txt","'","-",">","prediction","based","on","margin","[","dataset","provided","here","]","Each","row","has","a","64-element","feature","vector","followed","by","the","Class","label",".","There","is","a","total","of","1600","samples","with","16","samples","per","leaf","class","(","100","classes",")",",","and","no","missing","values",".","Three","64","element","feature","vectors","per","sample",".","Parameters","--","--","--","--","--","root",":","string","Root","directory","where","the","dataset","folder","`","one_hundred_plants_margin","`","exists",".","num_classes_per_task",":","int","Number","of","classes","per","tasks",".","This","corresponds","to","``","N","''","in","``","N-way","''","classification",".","meta_train",":","bool","(","default",":","`","False","`",")","Use","the","meta-train","split","of","the","dataset",".","If","set","to","`","True","`",",","then","the","arguments","`","meta_val","`","and","`","meta_test","`","must","be","set","to","`","False","`",".","Exactly","one","of","these","three","arguments","must","be","set","to","`","True","`",".","meta_val",":","bool","(","default",":","`","False","`",")","Use","the","meta-validation","split","of","the","dataset",".","If","set","to","`","True","`",",","then","the","arguments","`","meta_train","`","and","`","meta_test","`","must","be","set","to","`","False","`",".","Exactly","one","of","these","three","arguments","must","be","set","to","`","True","`",".","meta_test",":","bool","(","default",":","`","False","`",")","Use","the","meta-test","split","of","the","dataset",".","If","set","to","`","True","`",",","then","the","arguments","`","meta_train","`","and","`","meta_val","`","must","be","set","to","`","False","`",".","Exactly","one","of","these","three","arguments","must","be","set","to","`","True","`",".","meta_split",":","string","in","{","'train","'",",","'val","'",",","'test","'","}",",","optional","Name","of","the","split","to","use",".","This","overrides","the","arguments","`","meta_train","`",",","`","meta_val","`","and","`","meta_test","`","if","all","three","are","set","to","`","False","`",".","transform",":","callable",",","optional","A","function\/transform","that","takes","a","numpy","array","or","a","pytorch","array","(","depending","when","the","transforms","is","applied",")",",","and","returns","a","transformed","version",".","target_transform",":","callable",",","optional","A","function\/transform","that","takes","a","target",",","and","returns","a","transformed","version",".","dataset_transform",":","callable",",","optional","A","function\/transform","that","takes","a","dataset","(","ie",".","a","task",")",",","and","returns","a","transformed","version","of","it",".","E.g",".","`","torchmeta.transforms.ClassSplitter","(",")","`",".","class_augmentations",":","list","of","callable",",","optional","A","list","of","functions","that","augment","the","dataset","with","new","classes",".","These","classes","are","transformations","of","existing","classes",".","download",":","bool","(","default",":","`","False","`",")","If","`","True","`",",","downloads","the","original","files","and","processes","the","dataset","in","the","root","directory","(","under","the","`","one_hundred_plants_margin","'","folder",")",".","If","the","dataset","is","already","available",",","this","does","not","download\/process","the","dataset","again",".","process_features",":","bool","(","default",":","`","False","`",")","If","`","True","`",",","normalizes","each","feature","f","with","(","f-lower",")","\/","(","upper","-","lower",")","where","upper","and","lower","are","the","min","and","max","values","of","feature","f","of","the","meta-train","dataset",".","References","--","--","-","[","1","]","Charles","Mallah",",","James","Cope",",","James","Orwell",".","Plant","Leaf","Classification","Using","Probabilistic","Integration","of","Shape",",","Texture","and","Margin","Features",".","Signal","Processing",",","Pattern","Recognition","and","Applications",",","in","press",".","[","2","]","J",".","Cope",",","P.","Remagnino",",","S.","Barman",",","and","P.","Wilkin",".","Plant","texture","classification","using","gabor","co-occurrences",".","Advances","in","Visual","Computing",",","pages","699-677",",","2010",".","[","3","]","T.","Beghin",",","J",".","Cope",",","P.","Remagnino",",","and","S.","Barman",".","Shape","and","texture","based","plant","leaf","classification",".","In",":","Advanced","Concepts","for","Intelligent","Vision","Systems",",","pages","345-353",".","Springer",",","2010","."]
code: def __init__(
      self,
      root,
      num_classes_per_task=None,
      meta_train=False,
      meta_val=False,
      meta_test=False,
      meta_split=None,
      transform=None,
      target_transform=None,
      dataset_transform=None,
      class_augmentations=None,
      download=False,
      process_features=False,
  ):
      """
      One-hundred plant species leaves dataset (Class = Margin) [1], [2], [3]
      open-ml-id: 1491
      https://archive.ics.uci.edu/ml/datasets/One-hundred+plant+species+leaves+data+set) - 2010
  
  
         (a) Original owners of colour Leaves Samples:
  
       James Cope, Thibaut Beghin, Paolo Remagnino, Sarah Barman.
       The colour images are not included.
       The Leaves were collected in the Royal Botanic Gardens, Kew, UK.
       email: james.cope@kingston.ac.uk
  
         (b) This dataset consists of work carried out by James Cope, Charles Mallah, and James Orwell.
       Donor of database Charles Mallah: charles.mallah@kingston.ac.uk; James Cope:  james.cope@kingston.ac.uk
  
      The original data directory contains the binary images (masks) of the leaf samples (colour images not included).
      There are three features for each image: Shape, Margin and Texture.
      For each feature, a 64 element vector is given per leaf sample.
      These vectors are taken as a contiguous descriptor (for shape) or histograms (for texture and margin).
      So, there are three different files, one for each feature problem:
       * 'data_Sha_64.txt' -> prediction based on shape
       * 'data_Tex_64.txt' -> prediction based on texture
       * 'data_Mar_64.txt' -> prediction based on margin [dataset provided here]
  
      Each row has a 64-element feature vector followed by the Class label.
      There is a total of 1600 samples with 16 samples per leaf class (100 classes), and no missing values.
  
      Three 64 element feature vectors per sample.
  
      Parameters
      ----------
      root : string
          Root directory where the dataset folder `one_hundred_plants_margin` exists.
  
      num_classes_per_task : int
          Number of classes per tasks. This corresponds to "N" in "N-way"
          classification.
  
      meta_train : bool (default: `False`)
          Use the meta-train split of the dataset. If set to `True`, then the
          arguments `meta_val` and `meta_test` must be set to `False`. Exactly one
          of these three arguments must be set to `True`.
  
      meta_val : bool (default: `False`)
          Use the meta-validation split of the dataset. If set to `True`, then the
          arguments `meta_train` and `meta_test` must be set to `False`. Exactly
          one of these three arguments must be set to `True`.
  
      meta_test : bool (default: `False`)
          Use the meta-test split of the dataset. If set to `True`, then the
          arguments `meta_train` and `meta_val` must be set to `False`. Exactly
          one of these three arguments must be set to `True`.
  
      meta_split : string in {'train', 'val', 'test'}, optional
          Name of the split to use. This overrides the arguments `meta_train`,
          `meta_val` and `meta_test` if all three are set to `False`.
  
      transform : callable, optional
          A function/transform that takes a numpy array or a pytorch array
          (depending when the transforms is applied), and returns a transformed
          version.
  
      target_transform : callable, optional
          A function/transform that takes a target, and returns a transformed
          version.
  
      dataset_transform : callable, optional
          A function/transform that takes a dataset (ie. a task), and returns a
          transformed version of it. E.g. `torchmeta.transforms.ClassSplitter()`.
  
      class_augmentations : list of callable, optional
          A list of functions that augment the dataset with new classes. These
          classes are transformations of existing classes.
  
      download : bool (default: `False`)
          If `True`, downloads the original files and processes the dataset in the
          root directory (under the `one_hundred_plants_margin' folder). If the dataset
          is already available, this does not download/process the dataset again.
  
      process_features : bool (default: `False`)
          If `True`, normalizes each feature f with (f-lower) / (upper - lower) where upper
          and lower are the min and max values of feature f of the meta-train dataset.
  
      References
      -----
      [1] Charles Mallah, James Cope, James Orwell.
      Plant Leaf Classification Using Probabilistic Integration of Shape, Texture and Margin Features.
      Signal Processing, Pattern Recognition and Applications, in press.
  
      [2] J. Cope, P. Remagnino, S. Barman, and P. Wilkin.
      Plant texture classification using gabor co-occurrences.
      Advances in Visual Computing, pages 699-677, 2010.
  
      [3] T. Beghin, J. Cope, P. Remagnino, and S. Barman.
      Shape and texture based plant leaf classification.
      In: Advanced Concepts for Intelligent Vision Systems, pages 345-353. Springer, 2010.
  
      """
      dataset = PlantsMarginClassDataset(
          root,
          meta_train=meta_train,
          meta_val=meta_val,
          meta_test=meta_test,
          meta_split=meta_split,
          transform=transform,
          class_augmentations=class_augmentations,
          download=download,
          normalize=process_features,
      )
      super(PlantsMargin, self).__init__(
          dataset,
          num_classes_per_task,
          target_transform=target_transform,
          dataset_transform=dataset_transform,
      )
  
imports: import numpy
  import os
  import json
  import h5py
  from tqdm import tqdm
  from torchmeta.utils.data import Dataset, ClassDataset, CombinationMetaDataset
  from torchmeta.datasets.utils import get_asset
label_desc: Use image node_id 1 to create a new PlantsMargin object from inherited base classes: CombinationMetaDataset with example: obj = PlantsMargin(root, num_classes_per_task, meta_train, meta_val, meta_test, meta_split, transform, target_transform, dataset_transform, class_augmentations, download, process_features)