Flip images in multiple directories for data augmentation with no effort
When preparing a dataset for training a neural network, You would like to fully exploit that dataset to increase your network's accuracy as many papers provided evidence that some of these methods do improve the network's recognition ability, Some of those methods are flipping the images horizontally and scaling the images, all while keeping the original images unscathed. Picture from the oppenheimer's famous words video. Assuming you are using linux or macOS, First you will need to install graphics magick which is super simple sudo apt-get install graphicsmagick we will use the mogrify function from graphics magic to flip and resize images. import subprocess def prepare_dataset(): DIR_PARENTS = ['dir1/', 'dir2/', ...