In this project, we want to produce images of flowers using a DCGAN (Deep Convolutional Generative Adversarial Network) model. For this purpose, we use the tf_flower dataset, the link of which is given below.
https://www.tensorflow.org/datasets/catalog/tf_flowers
Generative Adversarial Networks (GANs) are one of the most interesting ideas in computer science today. Two models are trained simultaneously by an adversarial process. A generator ("the artist") learns to create images that look real, while a discriminator ("the art critic") learns to tell real images apart from fakes.
During training, the generator progressively becomes better at creating images that look real, while the discriminator becomes better at telling them apart. The process reaches equilibrium when the discriminator can no longer distinguish real images from fakes.
The following libraries are used in this project.
- Python 3.8.10
- Keras 2.11.0
- Tensorflow 2.11.0
- Jupyter Notebook
- If you want to run the project on your local machine, follow the steps below:
- It is recommended to create a conda environment.
conda create -n [your-env-name] python=3.8
- Go to the project directory
- Install requirements by running
pip install -r requirements.txt
- If you want to run the project on Google Colab, Run the following codes to install the required libraries to generate the gif file:
!pip install imageio
!pip install git+https://github.com/tensorflow/docs
Run the cells of the "GAN_Flower.ipynb" file in order to generate the flower images and train the implemented GAN model.
Please read the "GAN_Flower_Report_fa.pdf" file in the report folder before running the code to familiarize with the implemented model.
Note that in order to download the latest checkpoint and restore the trained model, you must download it using the link in the ckpt-10.txt file in the model_checkpoints folder. (GitHub does not allow uploading files larger than 100 MB!)
Flower images generated by the implemented DCGAN model:
This project is licensed under the MIT License.
If you have any questions about the implementation of the project, you can send your questions to this email: [email protected]