A procedural city generator using generative adversarial networks. The main generator was trained using Nvidia's StyleGAN2.
This library also provides a Pix2Pix GAN that is capable of generating a realistic map given an input image representing road networks.
This library has been successfully tested with the following versions:
However, meeting the below minimum requirements should suffice.
In order to successfully clone this repository, Git LFS is required.
After installing Git LFS and cloning this repository, run git lfs pull
in order to ensure that the models are successfully downloaded.
sudo apt install nvidia-cuda-toolkit
conda create -n citygan python=3.7
conda activate citygan
conda install --file=requirements.txt
from citygan.citygan import CityGan
city_gan = CityGan()
city_map = city_gan.generate_map()
This library comes with a GUI demonstrating features of the library. Simply run gui.py
after performing the relevant setup steps listed below.
sudo apt install python3-gi python3-gi-cairo gir.12-gtk-3.0 libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev
conda install -c conda-forge pygobject pycairo gtk3
If on Windows, installing GTK via instructions provided here https://www.gtk.org/docs/installations/windows should be sufficient along with installing pycairo and PyGObject from pip.
Full documentation on installing PyGObject can be found here: https://pygobject.readthedocs.io/en/latest/getting_started.html
The developer generated GAN files are included in the github repository, but not in the PyPi Package. If you downloaded from PyPi you must also download the model files. The pix2pix model can be found here and the CityGan model can be found here. The file structure should match what you see in the git repository.