This is the official repo of GANmapper, a building footprint generator using Generative Adversarial Networks
Use environment.yml
to create a conda environment for GANmapper
conda env create -f environment.yml
conda activate GANmapper
Predictions can be carried out by running the following sample code. The name of the city depends on the name of each dataset.
python predict.py --dataroot <path to XYZ tile dir> --checkpoints_dir <path to checkpoint> --name <cityname>
Testing an area in LA:
python predict.py --dataroot datasets/Exp4/LA/Source --checkpoints_dir checkpoints/Exp3 --name LA
Testing an area in Singapore:
python predict.py --dataroot datasets/Exp4/Singapore/Source --checkpoints_dir checkpoints/Exp3 --name Singapore
The result will be produced in XYZ directories in ./results/<cityname>/test_latest/images/fake
You can choose to visualise the tiles in QGIS using a local WMTS server.
For example, use the following url and choose Zomm 16 only.
file:///D:/GANmapper//results/Singapore/test_latest/images/fake/{z}/{x}/{y}.png
If you want the output to be in Geojson polygons, use extract.py
python extract.py <tile_dir> <out>
python extract.py results/Exp4/LA/test_latest/images/fake LA.geojson
Distributed under the MIT License. See LICENSE
for more information.
GANmapper is made possible by using the following packages