Haozhe Xie, Zhaoxi Chen, Fangzhou Hong, Ziwei Liu
S-Lab, Nanyang Technological University
- [2025/02/27] The training and testing code is released.
- [2025/02/27] The HuggingFace demo is released.
- [2024/05/24] The repo is created.
@inproceedings{xie2025gaussiancity,
title = {Generative Gaussian Splatting for Unbounded 3{D} City Generation},
author = {Xie, Haozhe and
Chen, Zhaoxi and
Hong, Fangzhou and
Liu, Ziwei},
booktitle = {CVPR},
year = {2025}
}
Datasets
Pretrained Models
Assume that you have installed CUDA and PyTorch in your Python (or Anaconda) environment.
The GaussianCity source code is tested in PyTorch 2.4.1 with CUDA 11.8 in Python 3.11. You can use the following command to install PyTorch built on CUDA 11.8.
pip install torch==2.4.1 torchvision==0.19.1 --index-url https://download.pytorch.org/whl/cu118
After that, the Python dependencies can be installed as following.
git clone https://github.com/hzxie/GaussianCity
cd GaussianCity
GCITY_HOME=`pwd`
pip install -r requirements.txt
The CUDA extensions can be compiled and installed with the following commands.
cd $GCITY_HOME/extensions
for e in `ls -d */`
do
cd $GCITY_HOME/extensions/$e
pip install .
done
The command line interface (CLI) by default load the pretrained models for Background Generator and Building Generator from output/rest.pth
and output/bldg.pth
, respectively. You have the option to specify a different location using runtime arguments.
βββ ...
βββ GaussianCity
βββ scripts
| βββ ...
| βββ inference.py
βββ output
βββ bldg.pth
βββ rest.pth
Run the following command to generate 3D cities. The output video will be saved at output/rendering.mp4
.
python3 scripts/inference.py
Important Note: The inference speed with inference.py
is NOT 60 times faster than CityDreamer, as the footprint_extruder
runs on the CPU for better compatibility. For faster inference, please use the GPU implementation available on Hugging Face.
By default, all scripts load the OSM and GoogleEarth datasets from ./data/osm
and ./data/google-earth
, respectively. You have the option to specify a different location using runtime arguments.
βββ ...
βββ GaussianCity
βββ data
βββ google-earth
βββ osm
- Generate semantic segmentation using SEEM, following the guidelines provided in CityDreamer's README.
- Generate instance segmetation with the following command.
cd $GCITY_HOME
python3 scripts/dataset_generator.py
Based on the default configuration file config.py
, modify the settings as follows:
cfg.DATASETS.GOOGLE_EARTH.TRAIN_N_INSTANCES = 0
cfg.DATASETS.GOOGLE_EARTH.TRAIN_INSTANCE_RANGE = [0, 10]
cfg.DATASETS.GOOGLE_EARTH.TRAIN_CROP_SIZE = (640, 448)
cfg.NETWORK.GAUSSIAN.SCALE_FACTOR = 0.5
cfg.NETWORK.GAUSSIAN.PTV3.ENABLED = False
cfg.NETWORK.GAUSSIAN.PTV3.ORDER = ("z")
torchrun --nnodes=1 --nproc_per_node=8 --standalone run.py -e BG-Exp
Based on the default configuration file config.py
, modify the settings as follows:
cfg.DATASETS.GOOGLE_EARTH.TRAIN_N_INSTANCES = 1
cfg.DATASETS.GOOGLE_EARTH.TRAIN_INSTANCE_RANGE = [10, 16384]
cfg.DATASETS.GOOGLE_EARTH.TRAIN_CROP_SIZE = (640, 448)
cfg.NETWORK.GAUSSIAN.SCALE_FACTOR = 0.5
cfg.NETWORK.GAUSSIAN.ENCODER = None
cfg.NETWORK.GAUSSIAN.ENCODER_OUT_DIM = 3
cfg.NETWORK.GAUSSIAN.POS_EMD = "SIN_COS"
cfg.NETWORK.GAUSSIAN.Z_DIM = 256
torchrun --nnodes=1 --nproc_per_node=8 --standalone run.py -e BLDG-Exp
This project is licensed under NTU S-Lab License 1.0. Redistribution and use should follow this license.