peal.teachers.virelay_teacher.ImageDataset

class peal.teachers.virelay_teacher.ImageDataset[source]

Bases: Dataset

All images of one directory as RGB tensors with a dummy label of 0.

Used to turn the copied collage images into the HDF5 dataset ViReLay displays. Files are listed with os.listdir (unsorted).

Parameters:
  • root_dir (str) – Directory whose every file is opened as an image.

  • transform (callable) – Applied to the PIL image; only the first three channels of the result are kept.

Methods

__init__(root_dir, transform=torchvision.transforms.ToTensor)[source]
Parameters:
  • root_dir (string) – Directory with all the images.

  • transform (callable, optional) – Optional transform to be applied on a sample.