title: Keras ImageDataGenerator flow_from_directory for segmentation with numpy array as image type
body: <p>I am using <code>ImageDataGenerator</code> with flow_from_directory for a segmentation task. </p>
  
  <p>Folders are structured as:</p>
  
  <blockquote>
  <pre><code>&gt;      MyData/TrainImages/Train/image001.npy
  &gt;      MyData/TrainMasks/Train/image001.npy
  &gt;      MyData/ValImages/Val/image002.npy
  &gt;      MyData/ValMasks/Val/image002.npy
  </code></pre>
  </blockquote>
  
  <p>I run:</p>
  
  <pre><code>train_datagen = ImageDataGenerator(
       #augmentation stuffs...)
  val_datagen = ImageDataGenerator(
       #ditto...)
  
  train_image_generator = train_datagen.flow_from_directory(
       'MyData/TrainImages/',
       batch_size = BS)
  train_mask_generator = train_datagen.flow_from_directory(
       'MyData/TrainMasks/',
       batch_size = BS)
  
  val_image_generator = val_datagen.flow_from_directory(
       'MyData/ValImages/',
       batch_size = BS)
  val_mask_generator = val_datagen.flow_from_directory(
       'MyData/ValMasks/',
       batch_size = BS)
  
  train_generator = zip(train_image_generator, train_mask_generator)
  val_generator = zip(val_image_generator, val_mask_generator)
  </code></pre>
  
  <p>but receive as output:</p>
  
  <blockquote>
  <pre><code>Found 0 images belonging to 1 classes.
  Found 0 images belonging to 1 classes.
  Found 0 images belonging to 1 classes.
  Found 0 images belonging to 1 classes.
  </code></pre>
  </blockquote>
  
  <p>I've googled around but most answers point to folder structure and I think mine is correct. Is this because my images are stored as numpy arrays rather than an expected format (jpg, png, etc.)?</p>