import tensorflow as tf

            images = images / 255 # Convert to [0, 1]
            return (images, classes)

        # Prepare train dataset
        def _preprocess_train(image, clazz):
            # Do random crop + horizontal flip for each train image
            image = tf.pad(image, [[4, 4], [4, 4], [0, 0]])
            image = tf.image.random_crop(image, (w, h, in_ch))
            image = tf.image.random_flip_left_right(image)

            if cutout_size > 0:
                image = self._do_cutout(image, w, h, cutout_size)

            return (image, clazz)

        (images, classes) = _prepare(images, classes)
