Skip to content
 
 

Repository files navigation

Learnable 2D Kernel for Planar Primitive

This repository contains the minimal code needed to run the 2DNS (2D neural splatting, proposed in Section 5.4 of Learning View-Dependent Splatting Kernels.) pretraining and benchmark pipeline.

Repository Layout

  • mlp_pretrain.py: pretrains the neural renderer checkpoint.
  • benchmark.py: runs dataset-level experiments and calls train.py.
  • train.py: main training entry point.
  • arguments/, gaussian_renderer/, scene/, utils/, lpipsPyTorch/: runtime Python modules.
  • submodules/beta_splat, submodules/diff-gaussian-rasterization, submodules/diff-neural-rasterization, submodules/diff-surfel-rasterization: vendored CUDA extension source code.
  • submodules/fused-ssim, submodules/simple-knn, and each glm dependency: Git submodules.

Environment

The tested setup uses Python 3.9, PyTorch 2.5.1 (cu124 wheel), a CUDA 12.x compiler, and local CUDA extensions under submodules/.

Clone with submodules enabled:

git clone <repo-url> --recursive
cd 2dns

If the repository was cloned without submodules:

git submodule update --init --recursive

Conda

conda env create -f environment.yml
conda activate 2dns
pip install -r requirements.txt

Before You Run

Update the dataset paths in script/run_b.sh and script/mlp_pretrain.sh to match your local setup:

source_root="/path/to/nerf_synthetic"
m360=/path/to/mipnerf360
tat=/path/to/tanks_and_temples
db=/path/to/deep_blending
ns=/path/to/nerf_synthetic

Pretraining

Example:

python mlp_pretrain.py \
  -s /path/to/nerf_synthetic/lego \
  -m ./output/pretrain/lego_test \
  --iteration 15000 \
  --num_init_pts 1 \
  --checkpoint_iterations 7000 15000 \
  --test_iterations 100 1000 7000 15000 \
  --decoder_size 8 \
  --latent3d_size 10 \
  --latent2d_size 10 \
  --latentMat_size 10 \
  --encoding_level 2 \
  --num_hidden_layers 3 \
  --sh_degree 3 \
  --eval

The expected checkpoint is:

<pretrain_output>/neural_render/iteration_15000/neural_render.pth

Benchmark

Single Scene (e.g., lego)

python benchmark.py \
  --output_path ./output/lego_test \
  -ns /path/to/nerf_synthetic \
  --scenes lego \
  -p ./output/pretrain/lego_test/neural_render/iteration_15000/neural_render.pth \
  --iterations 30000 \
  --checkpoint_iterations 7000 15000 20000 30000 \
  --test_iterations 7000 15000 20000 25000 28000 30000 \
  --latent3d_size 10 \
  --latent2d_size 10 \
  --latentMat_size 10 \
  --decoder_size 8 \
  --num_hidden_layers 3 \
  --sh_degree 3 \
  --encoding_level 2 \
  --neural_render_lr_init 0.00016 \
  --neural_render_lr_final 0.0000016 \
  --neural_render_lr_start_steps 2000 \
  --neural_render_lr_max_steps 30000 \
  --color_lr_init 0.001 \
  --color_lr_final 0.000001 \
  --color_lr_delay_steps 3000 \
  --color_lr_delay_mult 0.1 \
  --color_lr_start_steps 2000 \
  --proj_hidden_size 64 \
  --proj_hidden_num 3 \
  --color_hidden_size 128 \
  --color_hidden_num 4 \
  --opacity_lr 0.05 \
  --densify_until_iter 25000 \
  --color_mode sb

Full Benchmark (All Datasets)

To reproduce the full paper benchmark across all datasets, specify paths to each dataset directory. Omit --scenes to run all scenes automatically.

python benchmark.py \
  --output_path ./output/full_benchmark \
  -ns /path/to/nerf_synthetic \
  -m360 /path/to/mipnerf360 \
  -tat /path/to/tanks_and_temples \
  -db /path/to/deep_blending \
  -p /path/to/pretrained_checkpoint.pth \
  --iterations 30000 \
  --checkpoint_iterations 7000 15000 20000 30000 \
  --test_iterations 7000 15000 20000 25000 28000 30000 \
  --latent3d_size 10 \
  --latent2d_size 10 \
  --latentMat_size 10 \
  --decoder_size 8 \
  --num_hidden_layers 3 \
  --sh_degree 3 \
  --encoding_level 2 \
  --neural_render_lr_init 0.00016 \
  --neural_render_lr_final 0.0000016 \
  --neural_render_lr_start_steps 2000 \
  --neural_render_lr_max_steps 30000 \
  --color_lr_init 0.001 \
  --color_lr_final 0.000001 \
  --color_lr_delay_steps 3000 \
  --color_lr_delay_mult 0.1 \
  --color_lr_start_steps 2000 \
  --proj_hidden_size 64 \
  --proj_hidden_num 3 \
  --color_hidden_size 128 \
  --color_hidden_num 4 \
  --opacity_lr 0.05 \
  --densify_until_iter 25000 \
  --color_mode sb

The four supported datasets are:

  • NeRF Synthetic (-ns): chair, drums, ficus, hotdog, lego, materials, mic, ship
  • Mip-NeRF360 Outdoor (-m360): bicycle, flowers, garden, stump, treehill
  • Mip-NeRF360 Indoor (-m360): room, counter, kitchen, bonsai
  • Tanks & Temples (-tat): truck, train
  • Deep Blending (-db): drjohnson, playroom

Pass only the datasets you have available. Results are collected in a summary table under --output_path.

Citation

Cite as below if you find this repository is helpful to your project:

@inproceedings{ding2026kernel,
    title     = {Learning View-Dependent Splatting Kernels},
    author    = {Huakeng Ding and Zhangpeng Liu and Fan Pei and Kun Zhou and Hongzhi Wu},
    booktitle = {SIGGRAPH 2026 Conference Papers},
    year      = {2026}
}

Acknowledgments

We have intensively borrowed code from 2D Gaussian Splatting, 3D Gaussian Splatting, MCMC Gaussian Splatting, and Beta Splatting (beta color model). Many thanks to the authors for sharing their codes.

About

Code for SIGGRAPH 2026 paper "Learning view-dependent splatting kernel"

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors