karol-202 / direct-3dgs-segmentation

Semantic 3D segmentation of 3D Gaussian Splats
MIT License
2 stars 0 forks source link
tudelft-cse-research-project

Semantic 3D segmentation of 3D Gaussian Splats

This is the code repository for my Bachelor thesis: Semantic 3D segmentation of 3D Gaussian Splats: Assessing existing point cloud segmentation techniques on semantic segmentation of synthetic 3D Gaussian Splats scenes.

Paper abstract

3D Gaussian Splatting (3DGS) is a promising 3D reconstruction and novel-view synthesis technique. However, the field of semantic 3D segmentation of 3D Gaussian Splats scenes remains largely unexplored. This paper discusses the challenges of performing 3D segmentation directly on 3D Gaussian Splats, introduces a new dataset facilitating evaluation of 3DGS semantic segmentation and proposes use of PointNet++, initially developed for point cloud segmentation, as a 3DGS segmentation model. As the results show, PointNet++ is also capable of performing 3DGS segmentation with performance close to the performance achieved in point cloud segmentation tasks. When taking into account only the positions, 3D Gaussian splats appear to be more difficult for PointNet++ to process than point clouds sampled from mesh faces, possibly due to their irregularity. However, as shown in the paper, inclusion of size, rotation and opacity of each splat allows PointNet++ to achieve nearly 87% of accuracy, outperforming PointNet++ on point clouds sampled from meshes.

Link to the full paper: https://repository.tudelft.nl/record/uuid:387de885-1c53-4126-af25-19ebaa530a04

Overview

This repository contains:

Datasets

The 3DGS dataset used in the paper can be downloaded from: https://doi.org/10.4121/3eabd3f5-d814-48be-bbff-b440f2d48a2b.

The directory denoted by <DATASET_PATH> in the rest of this file is expected to have the following structure:

Additionally, to train the model on point clouds sampled from ModelNet10 meshes (used as the baseline in the paper), the ModelNet10 dataset is needed. The directory denoted by <MODELNET_PATH> in the rest of this file is expected to have the following structure:

The train.txt and test.txt files used in the paper can be found in data/. They are based on the original train/test split from the ModelNet10 dataset.

How to use

Prerequisites

Running most of the code in this repository (including dataset generation and model training) requires a graphics card with CUDA support.

Dataset generation

The 3DGS dataset linked above can be also recreated by using scripts from this repository.

Beware! This can take a lot of time.

For dataset generation:

To generate the dataset:

The paths in the scripts above need to be adjusted to match the local setup and directory structure.

Training

To use the code from this repository, a Conda environment must be set up. Assuming Conda is installed, the following command can be run to create the environment:

conda env create --file environment.yml

When the environment is created, it should be activated:

conda activate direct-3dgs

Training a single PointNet++ model can be performed using the train_3dgs.py script.

Training on 3DGS data using position, opacity, scale and rotation (quaternion):

python train_3dgs.py <DATASET_PATH> --model pointnet2_sem_seg --log_dir <EXPERIMENT_NAME> --batch_size <BATCH_SIZE> --epoch <EPOCHS> --extra_features opacity,scale,rotation_quat

Training on point clouds sampled from ModelNet10 meshes (the baseline):

python train_3dgs.py <MODELNET_PATH> --model pointnet2_sem_seg --log_dir <EXPERIMENT_NAME> --batch_size <BATCH_SIZE> --epoch <EPOCHS> --dataset_type SampledMesh

The trained model and training logs will be saved in log/sem_seg/<EXPERIMENT_NAME>.