delta.data.SegmentationDataset#
- class delta.data.SegmentationDataset(dataset, target_size, mode, *, kw_data_aug, crop, rng, stack=False)[source]#
Dataset used to train the segmentation model.
- __init__(dataset, target_size, mode, *, kw_data_aug, crop, rng, stack=False)[source]#
Create a new SegmentationDataset.
- Parameters
- datasetlist[tuple[Image, SegmentationMask, Image]]
Iterable on (image, segmentation mask, weights) tuples.
- target_size(int, int)
Target size of the images (input size of the neural network).
- modeMODE
In “training” mode, data augmentation is applied. In “evaluation” mode it is not.
- kw_data_augdict[str, Any]
Parameters for the data augmentation function (see data_augmentation).
- cropbool
If True, the images are cropped (randomly in training mode and with overlapping tiles in evaluation mode). If False, the images are simply resized to the target size.
- rngnpr.Generator
Random number generator.
- stackbool
If True, samples are shown in the form (image, labels_weights) where labels_weights is a stacked array of the labels and the weight map. This is to use the custom loss and densities. If False, samples are shown in the form (image, labels, weights). The default is False.
Methods
__init__
(dataset, target_size, mode, *, ...)Create a new SegmentationDataset.
on_epoch_end
()Shuffle the samples.
Attributes
max_queue_size
use_multiprocessing
workers