ganscapegenerator

Generating Landscapes Using DCGAN and StyleGAN3 🏞️

https://github.com/dalageo/ganscapegenerator

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary

Keywords

dcgan deep-learning gan image-generation nvidia nvidia-ngc python pytorch stylegan stylegan3
Last synced: 6 months ago · JSON representation ·

Repository

Generating Landscapes Using DCGAN and StyleGAN3 🏞️

Basic Info
  • Host: GitHub
  • Owner: Dalageo
  • License: agpl-3.0
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 8.73 MB
Statistics
  • Stars: 11
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Topics
dcgan deep-learning gan image-generation nvidia nvidia-ngc python pytorch stylegan stylegan3
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

Landscape-Gif
Python 3.9.20 PyTorch 2.5.1 CUDA 11.8 cuDNN 9.1.0 License: AGPLv3 GitHub stars

Generating Landscapes Using DCGAN and StyleGAN3 🏞️

This project examines image generative models, focusing on DCGAN and StyleGAN3. Initially, the project started by training a DCGAN to generate landscape images, but it was found that to create a decent DCGAN, you need a significantly larger and more diverse dataset, a carefully designed architecture, advanced techniques to stabilize training between the generator and discriminator, and sufficient computational resources to train effectively. As a result, the project did not delve deeply into developing the most powerful DCGAN architecture. Instead, it explored the use of a pretrained variant of StyleGAN3, originally provided by NVIDIA and further fine-tuned on landscape images by Justin Pinkney.

More specifically, the model used is the StyleGAN3-t LHQ 256, which is a StyleGAN3-t model further trained on 15 million images of various landscapes at a resolution of 256x256. Examples of initial generated outputs from this model are shown in the following stacked arrangement of three images:

LHQExample

Further fine-tuning of this model was carried out for 50 epochs using the Landscape Pictures dataset, with the same seeds used to generate new landscape images after this additional training, which are displayed below. By comparing the two stacks of images, it is evident that the new dataset likely introduced greater colors and lighting variations, increased detail, and possibly more geographical diversity, since the landscapes in the second stack feature richer and more complex environments, ranging from detailed mountain terrains to lush, vibrant valleys.

FineTunedExample

Additional generated images are available in a GIF at the top of this repository, with the top three images generated by the StyleGAN3-t LHQ 256 and the bottom three by the further trained model. Below is a GIF of images generated by the provided DCGAN architecture:

DCGANExample

These images demonstrate the architecture's ability to generate landscape-like visuals, but with noticeable limitations such as lower resolution, simplified color schemes, and less realistic textures compared to the more advanced StyleGAN3 outputs. This difference highlights the benefits of using pre-trained models, especially when training resources are limited.

Dataset Description

The Landscape Pictures dataset, a collection of natural landscape photos from Flickr, was used to train both DCGAN and StyleGAN3-t LHQ 256 models. It consists of 4,300 images, representing a variety of landscape types. Details of these categories, including the number of pictures and a brief description of each, are provided in the table below:

| Landscape Category | Number of Pictures | Description | |-----------------------|--------------------|------------------------------------------| | landscapes | 900 | General landscape pictures | | landscapes_mountain | 900 | Pictures featuring mountain landscapes | | landscapes_desert | 100 | Pictures of desert landscapes | | landscapes_sea | 500 | Sea views and coastal landscapes | | landscapes_beach | 500 | Beach scenes | | landscapes_island | 500 | Pictures of island settings | | landscapes_japan | 900 | Landscapes located in Japan |

To adapt to my system's and model capabilities, the landscape images, which originally varied in resolution, were uniformly resized to a resolution of 256x256 pixels.

Setup Instructions

Local PC Local Environment Setup

  1. Clone the repository: ```sh git clone https://github.com/Dalageo/GANScapeGenerator.git

  2. Navigate to the cloned directory: ```sh cd GANScapeGenerator

For DCGAN:

  1. Open the GANScapeGenerator_DCGAN.ipynb using your preferred Jupyter-compatible environment (e.g., Jupyter Notebook, VS Code, or PyCharm)

  2. Update the dataset, model and output directory paths to point to the location of your local environment.

  3. Run the cells sequentially to reproduce the results.

For StyleGan3:

  1. Visit the StyleGAN3 repository and follow the installation instructions.

  2. Open the GANScapeGenerator_StyleGAN3.py using your preferred Python-compatible environment (e.g., VS Code, or PyCharm)

  3. Select a pretrained StyleGAN3 model suitable for your dataset:(e.g., NVIDIA's NGC catalog or Finetuned stylegan3 models on Hugging Face)

  4. Update the dataset, model and output directory paths

  5. Run the cells sequentially to reproduce the results.

To train the models on GPU, you will need to activate GPU support based on your operating system and install the required dependencies. You can follow this guide provided by PyTorch for detailed instructions.

Acknowledgments

Firstly, I would like to thank Alec Radford, Luke Metz, and Soumith Chintala for introducing DCGAN in their 2015 paper, "Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks".

Additionally, special thanks to NVIDIA for providing pretrained StyleGAN3 models for educational and research purposes, as well as Justin Pinkney for making available a StyleGAN3 variant that has been pretrained on the LHQ dataset.


Nvidia Logo

License

The provided fine-tuned StyleGAN3 model is licensed under the Nvidia Source Code License, the dataset is under the CC 1.0 Universal, while the accompanying documentation is licensed under the AGPL-3.0 license. AGPL-3.0 license was chosen to promote open collaboration, ensure transparency, and allow others to freely use, modify, and contribute to the work.

Any modifications or improvements must also be shared under the same license, with appropriate acknowledgment.


Nvidia-Logo       CC 1.0 Universal       AGPLv3-Logo

Owner

  • Login: Dalageo
  • Kind: user

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If this project was helpful, please cite it as below."
title: "GANScapeGenerator"
authors:
  - family-names: "Dalageorgos"
    given-names: "Konstantinos"
version: "1.0.0" 
date-released: "2024-12-10"
repository-code: "https://github.com/Dalageo/GANScapeGenerator"
license: "GNU Affero General Public License v3.0"

GitHub Events

Total
  • Watch event: 8
  • Public event: 1
  • Push event: 7
  • Fork event: 2
Last Year
  • Watch event: 8
  • Public event: 1
  • Push event: 7
  • Fork event: 2

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 5
  • Total Committers: 2
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.2
Past Year
  • Commits: 5
  • Committers: 2
  • Avg Commits per committer: 2.5
  • Development Distribution Score (DDS): 0.2
Top Committers
Name Email Commits
Konstantinos Dalageorgos k****s@g****m 4
Dalageo d****o 1

Issues and Pull Requests

Last synced: 7 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels