Shortcuts

folder

class trojanvision.datasets.CUB200(data_format='folder', memory=False, **kwargs)[source]

CUB200 dataset introduced by Peter Welinder in 2010. It inherits trojanvision.datasets.ImageFolder.

Variables:
  • name (str) – 'cub200'

  • num_classes (int) – 200

  • data_shape (list[int]) – [3, 224, 224]

  • valid_set (bool) – False

class trojanvision.datasets.CUB200_2011(data_format='folder', memory=False, **kwargs)[source]

CUB200_2011 dataset. It inherits trojanvision.datasets.ImageFolder.

Variables:
  • name (str) – 'cub200_2011'

  • num_classes (int) – 200

  • data_shape (list[int]) – [3, 224, 224]

  • valid_set (bool) – False

class trojanvision.datasets.GTSRB(norm_par={'mean': [0.3403, 0.3121, 0.3214], 'std': [0.2724, 0.2608, 0.2669]}, loss_weights=True, **kwargs)[source]

GTSRB dataset introduced by Johannes Stallkamp in 2011. It inherits trojanvision.datasets.ImageFolder.

Variables:
  • name (str) – 'gtsrb'

  • num_classes (int) – 43

  • data_shape (list[int]) – [3, 32, 32]

  • norm_par (dict[str, list[float]]) –

    {'mean': [0.3403, 0.3121, 0.3214],
    'std'  : [0.2724, 0.2608, 0.2669]}

  • valid_set (bool) – False

  • loss_weights (bool) – True

class trojanvision.datasets.ImageNet(norm_par={'mean': [0.485, 0.456, 0.406], 'std': [0.229, 0.224, 0.225]}, **kwargs)[source]

ImageNet (ILSVRC2012) dataset introduced by Jia Deng and Feifei Li in 2012. It inherits trojanvision.datasets.ImageFolder.

Note

According to https://github.com/pytorch/vision/issues/1563, You need to personally visit https://image-net.org/download-images.php to download the dataset.

Expected files:

  • '{self.folder_path}/ILSVRC2012_devkit_t12.tar.gz'

  • '{self.folder_path}/ILSVRC2012_img_train.tar'

  • '{self.folder_path}/ILSVRC2012_img_val.tar'

  • '{self.folder_path}/meta.bin'

Variables:
  • name (str) – 'imagenet'

  • num_classes (int) – 1000

  • data_shape (list[int]) – [3, 224, 224]

  • norm_par (dict[str, list[float]]) –

    {'mean': [0.485, 0.456, 0.406],
    'std'  : [0.229, 0.224, 0.225]}

class trojanvision.datasets.ISIC2018(data_format='folder', memory=False, **kwargs)[source]

ISIC2018 dataset introduced by Noel Codella in 2018. It inherits trojanvision.datasets.ImageFolder.

Variables:
  • name (str) – 'isic2018'

  • num_classes (int) – 7

  • data_shape (list[int]) – [3, 224, 224]

class trojanvision.datasets.VGGface2(data_format='folder', memory=False, **kwargs)[source]

VGGface2 dataset introduced by Qiong Cao in 2018. It inherits trojanvision.datasets.ImageFolder.

Variables:
  • name (str) – 'vggface2'

  • num_classes (int) – 8631 (Why the papaer claims to have 500 more?)

  • data_shape (list[int]) – [3, 224, 224]

  • valid_set (bool) – False

Docs

Access comprehensive developer documentation for TrojanZoo

View Docs