title: How are image resize in ImageDataGenerator
body: <p>In my understanding, when using tensorflow keras, we can flow data from directories using <code>ImageDataGenerator</code>. When the data is flowed in, they are resized to <code>target_size</code>. But how is this transformation done?</p>
  <p>An example is this:</p>
  <pre><code>from tensorflow.keras.preprocessing.image import ImageDataGenerator
  trainDir = 'train'
  dataGen = ImageDataGenerator(rescale=1/255)
  gen = dataGen.flow_from_directories(
    trainDir,
    batch_size=64,
    target_size=(150, 150),
    class_mode='binary'
  )
  </code></pre>
  <p>Here, all the images from <code>trainDir</code> would be resized to 150x150. But how are they resized?</p>
  <p>I've checked the <a href="https://www.tensorflow.org/api_docs/python/tf/keras/preprocessing/image/ImageDataGenerator" rel="nofollow noreferrer">documentation on tensorflow ImageDataGenerator</a>. It only says that <code>target_size</code> is &quot;The dimensions to which all images found will be resized.&quot; But I didn't find an explanation on how the resizing is done.</p>