dataset module

class dataset.SegmentationDataset(images_dir, masks_dir, transform=None)[source]

Bases: Dataset

Dataset for segmentation tasks. The images and masks should be placed in two different directories and have the same file names.

image_dir

Path to the directory containing the images

Type:

str

mask_dir

Path to the directory containing the masks

Type:

str

transform

Tranformation function to be applied to the images and masks in order to perform data augmentation.

Type:

Callable

images

List of image file names

Type:

List[str]

__len__(self)[source]

Return the length of the dataset

__getitem__(self, idx)[source]

Return the image and mask at the given index