Exploring the Data

The CelebA dataset contains over 200k annotated celebrity images. Since we are going to use GANs to generate similar images, it is worth looking at a bunch of images from the dataset and see how they look. In this section, we are going to define some helper functions for visualizing a bunch of images from the CelebA dataset.

Now, let's use the utils script to display some images from the dataset:

#number of images to display
num_images_to_show = 25

celebA_images = utils.get_batch(glob(os.path.join(celebA_data_dir, 'img_align_celeba/*.jpg'))[:num_images_to_show], 28,
28, 'RGB')
pyplot.imshow(utils.images_square_grid(celebA_images, 'RGB'))
Output:
Figure 2: Plotting a sample of images from CelebA dataset

The main focus of this computer vision task is to use GANs for generating images similar two the ones in the celebrity dataset, so we'll need to focus on the face part of the images. To focus on the face part of an image, we are going to remove the parts of the image that don't include a celebrity face.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset