martin_gorner_tf:

However, at this time, you cannot yet do joint preprocessing of the image and mask using Keras Preprocessing Layers so I cannot recommend that route yet.


Do we have a small example at:

  

      github.com
  

  
    keras-team/keras/blob/master/keras/preprocessing/image.py#L745-L776 41



      
      
          Example of transforming images and masks together.
          
          
```python
          # we create two instances with the same arguments
          data_gen_args = dict(featurewise_center=True,
                               featurewise_std_normalization=True,
                               rotation_range=90,
                               width_shift_range=0.1,
                               height_shift_range=0.1,
                               zoom_range=0.2)
          image_datagen = ImageDataGenerator(**data_gen_args)
          mask_datagen = ImageDataGenerator(**data_gen_args)
          # Provide the same seed and keyword arguments to the fit and flow methods
          seed = 1
          image_datagen.fit(images, augment=True, seed=seed)
          mask_datagen.fit(masks, augment=True, seed=seed)
          image_generator = image_datagen.flow_from_directory(
              'data/images',
              class_mode=None,
              seed=seed)
      
    
  

  This file has been truncated. show original