8000 GitHub - hzxie/GaussianCity: The official implementation of "GaussianCity: Generative Gaussian Splatting for Unbounded 3D City Generation". (CVPR 2025)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The official implementation of "GaussianCity: Generative Gaussian Splatting for Unbounded 3D City Generation". (CVPR 2025)

License

Notifications You must be signed in to change notification settings

hzxie/GaussianCity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Generative Gaussian Splatting for Unbounded 3D City Generation

Haozhe Xie, Zhaoxi Chen, Fangzhou Hong, Ziwei Liu

S-Lab, Nanyang Technological University

codebeat badge Counter arXiv HuggingFace YouTube

Teaser

Changelog πŸ”₯

  • [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.

Cite this work πŸ“

@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 πŸ›’οΈ

Datasets

Pretrained Models

Installation πŸ“₯

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

Inference 🚩

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.

TrainingπŸ‘©πŸ½β€πŸ’»

Dataset Preparation

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 
  1. Generate semantic segmentation using SEEM, following the guidelines provided in CityDreamer's README.
  2. Generate instance segmetation with the following command.
cd $GCITY_HOME
python3 scripts/dataset_generator.py

Training Background Generator

Update config.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")

Launch Training πŸš€

torchrun --nnodes=1 --nproc_per_node=8 --standalone run.py -e BG-Exp

Training Building Generator

Update config.py βš™οΈ

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

Launch Training πŸš€

torchrun --nnodes=1 --nproc_per_node=8 --standalone run.py -e BLDG-Exp

License

This project is licensed under NTU S-Lab License 1.0. Redistribution and use should follow this license.

About

The official implementation of "GaussianCity: Generative Gaussian Splatting for Unbounded 3D City Generation". (CVPR 2025)

Topics

Resources

License

Stars

Watchers

Forks

0