plotting augmented_img broken
When plotting augmented_img we obtain the same image as the original random image. This was confirmed by rerunning the original class notebook.
view a random image and compare it with augmented images
import matplotlib.pyplot as plt import matplotlib.image as mpimg import os import random target_class = random.choice(train_data_1_percent.class_names) target_dir = os.path.join(train_path_1per, target_class) random_image = random.choice(os.listdir(target_dir)) random_image_path = os.path.join(target_dir, random_image)
read and plot in the random image
img = mpimg.imread(random_image_path) plt.imshow(img) plt.title(f"Original image: {target_class}") plt.axis(False);
plot augmented image
augmented_img = data_augmentation(img, training=True) plt.figure() plt.imshow(tf.squeeze(augmented_img)/255.) plt.title(f"Augmented image: {target_class}") plt.axis(False);