Skip to content

Instantly share code, notes, and snippets.

View Hdooster's full-sized avatar

Hdooster

  • Ghent, Belgium
View GitHub Profile
@Hdooster
Hdooster / image_mask_generator.py
Last active April 7, 2020 11:33
Generates images and masks from memory,and can augment with an imgaug sequence provided as input.
class ImageMaskGenerator(Sequence):
def __init__(self, inputs, outputs, batch_size=32,
dim_after_preprocessing=None, shuffle=True,
input_channels=3, output_channels=1,
preprocessing_seq=None, augment_seq=None):
self.inputs = inputs
self.outputs = outputs
self.input_channels = input_channels
self.output_channels = output_channels
self.dim_after_preprocessing = dim_after_preprocessing or self.inputs[0].shape[:2]