January 2019
Intermediate to advanced
316 pages
8h 16m
English
Before doing anything else, load the dataset by performing the following steps:
imagesA = glob(data_dir + '/testA/*.*')imagesB = glob(data_dir + '/testB/*.*')
We have data from two domains, A and B, which is why we have created two lists.
allImagesA = []allImagesB = []# Iterate over the listsfor index, filename in enumerate(imagesA): # Load images imgA = imread(filename, mode='RGB') imgB = imread(imagesB[index], mode='RGB') # Resize images imgA = imresize(imgA, (128, 128)) imgB = imresize(imgB, (128, 128)) # Randomly horizontally flip ...
Read now
Unlock full access