Skip to content

Latest commit

 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UrbanControlNet

Introduction

The repository contains the code implementation of the paper: Envisioning Global Urban Development with Satellite Imagery and Generative AI.

Table of Contents

Installation

Download or clone the repository.

git clone https://github.com/kailaisun/UrbanControlNet.git
cd UrbanControlNet

We recommend using Conda (Miniconda) for installation.

Environment Installation

Create a virtual environment named mambacontrol and activate it.

conda env create -f environment.yaml
conda activate mambacontrol

Dataset Preparation

The dataset is built from publicly available global sources:

Dataset Download

Download land use, building, and basemap data:

cd dataset
python download_mapbox_tiles.py  
python download_osm_landuse_building.py  

Create DEM, hint, and satellite images:

python create_dem_image.py  
python create_hint_image.py  
python create_satellite_image.py  

Compute grid density and land use–road metrics:

python compute_grid_density_gee.py  
python create_landuse_road_metrics.py  

Model Training

Finetuning

cd Urbancontrolnet
python train_density.py 

Finetuning decoder

Set sd_locked = False, then

python train_density.py

Model Testing

Checkpoints:

-We provide two checkpoints (one is finetuned on 100 cities with better performance; another is finetuned on 500 cities with larger coverage):Download

Urban Satelliate Image Generation:

Download checkpoints, make a new folder (checkpoints_density), and change the lines at results_view_loop_density.py:

ckpt_directory = f'./checkpoints_density'
ckpt_epoch_list = ['100'] 
output_file_dir = f'./output_image/city_'
python results_view_loop_density.py

Metric Prediction Model

Training

python prediction_train.py

Model evaluation

For computing metric (e.g., FID, ID, SSIM, FSIM, PSNR, etc.), please see our another repo: Evaluation-Metrics

Acknowledgements

Citation

License

The repository is licensed under the Apache 2.0 license.

Contact Us

If you have other questions❓, please contact us in time 👬

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages