Skip to content

Xiaohan-Z/TraGraph-GS

Repository files navigation

TraGraph-GS: Trajectory Graph-based Gaussian Splatting for Arbitrary Large-Scale Scene Rendering [TPAMI 2026]

1. Setup

Tested Environment

Ubuntu 22.04.5 LTS, Nvidia GeForce 4090, CUDA 11.8.

Our training and testing are conducted using a single 24GB 4090 GPU.

Clone the repo

git clone https://github.com/Xiaohan-Z/TraGraph-GS.git --recursive

Environment setup

conda env create -f environment.yml
conda activate traGS
pip install submodules/diff-gaussian-rasterization
pip install submodules/simple-knn
pip install submodules/Propagation

2. Datasets

Aerial Datasets

The aerial datasets we use, along with the training/test split, is the same as in CityGaussian.

Street Datasets

The street datasets Small-City and Campus we use, along with the training/test split, is the same as in Hierarchy-GS. Our own dataset can be obtained from the following link: https://pan.baidu.com/s/1NVB0FmB-cbluQPwkvfIPOw?pwd=sdcr, extraction code: sdcr, and every 8th image is sampled to construct the test set.

Cross-View Datasets

The aerial datasets we use, along with the training/test split, is the same as in HorizonGS.

3. Usage

Feature Extraction and Matching

Here we use COLMAP to compute feature extraction and matching for the images and take the Rubble scene from the aerial dataset as an example. The database.db files for feature extraction and matching for all datasets used in the paper can be downloaded from the link: https://pan.baidu.com/s/1Y50c_U1N4muVDWSzy5Yfqg?pwd=dd9g, extraction code: dd9g.

colmap feature_extractor \
    --database_path /data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/database.db \
    --image_path /data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/images \
    --ImageReader.camera_model SIMPLE_PINHOLE \
    --SiftExtraction.use_gpu 1

colmap exhaustive_matcher \
    --database_path /data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/database.db \
    --SiftMatching.use_gpu 1

[Optional] We recommend using the plug-and-play module Doppelgangers++ to improve feature matching accuracy.

Train & Eval

First, run colmap2graph_new.py to perform graph-based partitioning based on the feature extraction and matching file database.db, and then train each partition separately. Taking the Rubble dataset as an example:

Step1: Divide the entire scene into 1 region and train a global coarse Gaussian

python colmap2graph_new.py "/data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/database.db" "/data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/colmap_graph.png" -n 1 --simplify_percentile 50

CUDA_VISIBLE_DEVICES=0 python train.py -s "/data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train" -m "rubble_new_global" \
                --position_lr_init 0.000016 --scaling_lr 0.001 --percent_dense 0.0005 --port 1021 \
                --region 0 --resolution 8 --global_train --region_num 1

Step2: Divide the entire scene into 8 regions, and train separately on each region

python colmap2graph_new.py "/data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/database.db" "/data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train/colmap_graph.png" -n 8 --simplify_percentile 50

for i in {0,1,2,3,4,5,6,7}
do
    CUDA_VISIBLE_DEVICES=0 python train.py -s "/data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train" -m "rubble_new_m6_8_${i}" \
                --eval --flatten_loss --position_lr_init 0.00002 --position_lr_final 0.0000002 --percent_dense 0.0001 --densification_interval 100 --densify_grad_threshold 0.015 --port 1021 \
                --normal_loss --depth_loss --propagation_interval 50 --depth_error_min_threshold 0.8 --depth_error_max_threshold 1.0 \
                --propagated_iteration_begin 1000 --propagated_iteration_after 6000 --patch_size 20 --lambda_l1_normal 0.001 --lambda_cos_normal 0.001 --contract --max_dense \
                --resolution 4 --region ${i} --n_neighbors 4 --region_num 8 --max_split_generation 6 --train_val_partition
done

Step3: Progressive rendering and testing

 CUDA_VISIBLE_DEVICES=0 python render_ssim_fast.py -s /data02/zxh/aerial/data/TPAMI/building_rubble/rubble-pixsfm/train --gaussian_list "rubble_new_m6_8_0" "rubble_new_m6_8_1" "rubble_new_m6_8_2" "rubble_new_m6_8_3" "rubble_new_m6_8_4" "rubble_new_m6_8_5" "rubble_new_m6_8_6" "rubble_new_m6_8_7" "rubble_new_global" \
 --pro_clusters 2

python metrics.py -m rubble_new_global

If you want to additionally compute depth and normals, please run render_ssim_fast_dn.py. We have also provided the training configurations for all the scenes in the paper in scripts/tra-GS_arrange.sh.

4. Acknowledgement

Our code is built upon 3D-GS, Gaussianpro, PVG, CityGaussian, Hierarchy-GS, HorizonGS, and Doppelgangers++. We thank all these authors for their nicely open sourced code and their great contributions to the community.

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors