This repository is a community implementation of the paper Learning to Segment 3D Point Clouds in 2D Image Space by Lyu et al. using the PyTorch framework. The official TensorFlow implementation by the authors can be found here.
Install the conda environment with all necessary packages by
conda env create -f environment.yml
and activate it by
conda activate 3d-seg-in-2d
./download_data.sh
will download and extract the ShapeNet Part dataset from Stanford University into the directory hdf5_data
.
python prepare_dataset.py
Create a custom configuration file custom_config.yaml
or use the default config.yaml
to determine the hyperparameters and other settings. Run
python train_unet.py --config_path custom_config.yaml
or simply python train_unet.py
to use the default configuration.
device
: Enable CUDA acceleration by setting the device in the configuration todevice: 'cuda:0'
or similar. MPS for Apple Silicon is also supported, set the device todevice: 'mps'
.
python test.py --model_path <MODEL_PATH>
to evaluate the model located at <MODEL_PATH>
.
To visualize the segmentation result for class <idx_class>
and sample <idx_class_sample>
, run
python visualization.py <idx_class> <idx_class_sample>
You can run the pre-commit hooks locally with pre-commit run
.