Have you ever wondered how photo editing applications are able to convert night images to day images? Also, you must have come across some photos of people who do not exist in the world. One of the powerful tools to achieve this is Generative Adversarial Networks, also known as GAN. GANs are mainly used in image-to-image translation and to generate photorealistic images that even a human fails to identify as fake or true.
In this project the PyTorch framework is used to build the GAN model on the MNIST dataset. Finally, we learn how to use the Generator model for generating new images of digits.
- Language:
Python
- Libraries:
torch
,torchvision
,numpy
,matplotlib
- Introduction to Generative Adversarial Network
- Introduction to Generator and Discriminator
- Loss function in GAN
- Building Model on PyTorch
- Model training on Google Colab
- Generating fake images with Generator
- data: Contains data_utils.py file, which is used to download and transform the data. It will download and store the data in the respective folder.
- model: Contains gan.py
- run.py: Contains the main code where all functions are called.
- train.py: Contains the code for model training.
- requirements.txt: Lists all the required libraries with respective versions. Install the file using the command
pip install -r requirements.txt
. Note: Please use CUDA versions of torch if CUDA is available.