All Projects β†’ loicland β†’ Superpoint_graph

loicland / Superpoint_graph

Licence: mit
Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Superpoint graph

Depth clustering
πŸš• Fast and robust clustering of point clouds generated with a Velodyne sensor.
Stars: ✭ 657 (+23.26%)
Mutual labels:  point-cloud, lidar, segmentation, clustering
Cilantro
A lean C++ library for working with point cloud data
Stars: ✭ 577 (+8.26%)
Mutual labels:  point-cloud, segmentation, clustering
Lidar Bonnetal
Semantic and Instance Segmentation of LiDAR point clouds for autonomous driving
Stars: ✭ 465 (-12.76%)
Mutual labels:  lidar, segmentation, semantic
wasr network
WaSR Segmentation Network for Unmanned Surface Vehicles v0.5
Stars: ✭ 32 (-94%)
Mutual labels:  semantic, segmentation, semantic-segmentation
Bcdu Net
BCDU-Net : Medical Image Segmentation
Stars: ✭ 314 (-41.09%)
Mutual labels:  segmentation, semantic-segmentation, semantic
Erfnet pytorch
Pytorch code for semantic segmentation using ERFNet
Stars: ✭ 304 (-42.96%)
Mutual labels:  segmentation, semantic-segmentation, semantic
pointnet2-pytorch
A clean PointNet++ segmentation model implementation. Support batch of samples with different number of points.
Stars: ✭ 45 (-91.56%)
Mutual labels:  point-cloud, segmentation
pointnet2 semantic
A pointnet++ fork, with focus on semantic segmentation of differents datasets
Stars: ✭ 69 (-87.05%)
Mutual labels:  point-cloud, semantic-segmentation
3d cnn tensorflow
KITTI data processing and 3D CNN for Vehicle Detection
Stars: ✭ 266 (-50.09%)
Mutual labels:  point-cloud, lidar
Cascaded Fcn
Source code for the MICCAI 2016 Paper "Automatic Liver and Lesion Segmentation in CT Using Cascaded Fully Convolutional NeuralNetworks and 3D Conditional Random Fields"
Stars: ✭ 296 (-44.47%)
Mutual labels:  segmentation, semantic-segmentation
urban road filter
Real-time LIDAR-based Urban Road and Sidewalk detection for Autonomous Vehicles πŸš—
Stars: ✭ 134 (-74.86%)
Mutual labels:  point-cloud, lidar
Open3d Ml
An extension of Open3D to address 3D Machine Learning tasks
Stars: ✭ 284 (-46.72%)
Mutual labels:  lidar, semantic-segmentation
Segmentation models.pytorch
Segmentation models with pretrained backbones. PyTorch.
Stars: ✭ 4,584 (+760.04%)
Mutual labels:  segmentation, semantic-segmentation
BtcDet
Behind the Curtain: Learning Occluded Shapes for 3D Object Detection
Stars: ✭ 104 (-80.49%)
Mutual labels:  point-cloud, lidar
pyconvsegnet
Semantic Segmentation PyTorch code for our paper: Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition (https://arxiv.org/pdf/2006.11538.pdf)
Stars: ✭ 32 (-94%)
Mutual labels:  segmentation, semantic-segmentation
TensorFlow-Advanced-Segmentation-Models
A Python Library for High-Level Semantic Segmentation Models based on TensorFlow and Keras with pretrained backbones.
Stars: ✭ 64 (-87.99%)
Mutual labels:  segmentation, semantic-segmentation
awesome-lidar
😎 Awesome LIDAR list. The list includes LIDAR manufacturers, datasets, point cloud-processing algorithms, point cloud frameworks and simulators.
Stars: ✭ 217 (-59.29%)
Mutual labels:  point-cloud, lidar
Pointnet
PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation
Stars: ✭ 3,517 (+559.85%)
Mutual labels:  point-cloud, segmentation
Lidr
R package for airborne LiDAR data manipulation and visualisation for forestry application
Stars: ✭ 310 (-41.84%)
Mutual labels:  point-cloud, lidar
Segmentation-Series-Chaos
Summary and experiment includes basic segmentation, human segmentation, human or portrait matting for both image and video.
Stars: ✭ 75 (-85.93%)
Mutual labels:  segmentation, semantic-segmentation

Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs

This is the official PyTorch implementation of the papers:

Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs http://arxiv.org/abs/1711.09869

by Loic Landrieu and Martin Simonovski (CVPR2018),

and

Point Cloud Oversegmentation with Graph-Structured Deep Metric Learning https://arxiv.org/pdf/1904.02113.

by Loic Landrieu and Mohamed Boussaha (CVPR2019),

Code structure

  • ./partition/* - Partition code (geometric partitioning and superpoint graph construction using handcrafted features)
  • ./supervized_partition/* - Supervized partition code (partitioning with learned features)
  • ./learning/* - Learning code (superpoint embedding and contextual segmentation).

To switch to the stable branch with only SPG, switch to release.

Disclaimer

Our partition method is inherently stochastic. Hence, even if we provide the trained weights, it is possible that the results that you obtain differ slightly from the ones presented in the paper.

Requirements

0. Download current version of the repository. We recommend using the --recurse-submodules option to make sure the cut pursuit module used in /partition is downloaded in the process. Wether you did not used the following command, please, refer to point 4:

git clone --recurse-submodules https://github.com/loicland/superpoint_graph

1. Install PyTorch and torchnet.

pip install git+https://github.com/pytorch/[email protected]

2. Install additional Python packages:

pip install future python-igraph tqdm transforms3d pynvrtc fastrlock cupy h5py sklearn plyfile scipy

3. Install Boost (1.63.0 or newer) and Eigen3, in Conda:

conda install -c anaconda boost; conda install -c omnia eigen3; conda install eigen; conda install -c r libiconv

4. Make sure that cut pursuit was downloaded. Otherwise, clone this repository or add it as a submodule in /partition:

cd partition
git submodule init
git submodule update --remote cut-pursuit

5. Compile the libply_c and libcp libraries:

CONDAENV=YOUR_CONDA_ENVIRONMENT_LOCATION
cd partition/ply_c
cmake . -DPYTHON_LIBRARY=$CONDAENV/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=$CONDAENV/include/python3.6m -DBOOST_INCLUDEDIR=$CONDAENV/include -DEIGEN3_INCLUDE_DIR=$CONDAENV/include/eigen3
make
cd ..
cd cut-pursuit
mkdir build
cd build
cmake .. -DPYTHON_LIBRARY=$CONDAENV/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=$CONDAENV/include/python3.6m -DBOOST_INCLUDEDIR=$CONDAENV/include -DEIGEN3_INCLUDE_DIR=$CONDAENV/include/eigen3
make

6. (optional) Install Pytorch Geometric

The code was tested on Ubuntu 14 and 16 with Python 3.5 to 3.8 and PyTorch 0.2 to 1.3.

Troubleshooting

Common sources of errors and how to fix them:

  • $CONDAENV is not well defined : define it or replace $CONDAENV by the absolute path of your conda environment (find it with locate anaconda)
  • anaconda uses a different version of python than 3.6m : adapt it in the command. Find which version of python conda is using with locate anaconda3/lib/libpython
  • you are using boost 1.62 or older: update it
  • cut pursuit did not download: manually clone it in the partition folder or add it as a submodule as proposed in the requirements, point 4.
  • error in make: 'numpy/ndarrayobject.h' file not found: set symbolic link to python site-package with sudo ln -s $CONDAENV/lib/python3.7/site-packages/numpy/core/include/numpy $CONDAENV/include/numpy

Running the code

To run our code or retrain from scratch on different datasets, see the corresponding readme files. Currently supported dataset are as follow:

Dataset handcrafted partition learned partition
S3DIS yes yes
Semantic3D yes to come soon
vKITTI3D no yes
ScanNet to come soon to come soon

To use pytorch-geometric graph convolutions instead of our own, use the option --use_pyg 1 in ./learning/main.py. Their code is more stable and just as fast. Otherwise, use --use_pyg 0

Evaluation

To evaluate quantitatively a trained model, use (for S3DIS and vKITTI3D only):

python learning/evaluate.py --dataset s3dis --odir results/s3dis/best --cvfold 123456

To visualize the results and all intermediary steps, use the visualize function in partition (for S3DIS, vKITTI3D,a nd Semantic3D). For example:

python partition/visualize.py --dataset s3dis --ROOT_PATH $S3DIR_DIR --res_file results/s3dis/pretrained/cv1/predictions_test --file_path Area_1/conferenceRoom_1 --output_type igfpres

output_type defined as such:

  • 'i' = input rgb point cloud
  • 'g' = ground truth (if available), with the predefined class to color mapping
  • 'f' = geometric feature with color code: red = linearity, green = planarity, blue = verticality
  • 'p' = partition, with a random color for each superpoint
  • 'r' = result cloud, with the predefined class to color mapping
  • 'e' = error cloud, with green/red hue for correct/faulty prediction
  • 's' = superedge structure of the superpoint (toggle wireframe on meshlab to view it)

Add option --upsample 1 if you want the prediction file to be on the original, unpruned data (long).

Other data sets

You can apply SPG on your own data set with minimal changes:

  • adapt references to custom_dataset in /partition/partition.py
  • you will need to create the function read_custom_format in /partition/provider.py which outputs xyz and rgb values, as well as semantic labels if available (already implemented for ply and las files)
  • adapt the template function /learning/custom_dataset.py to your achitecture and design choices
  • adapt references to custom_dataset in /learning/main.py
  • add your data set colormap to get_color_from_label in /partition/provider.py
  • adapt line 212 of learning/spg.py to reflect the missing or extra point features
  • change --model_config to gru_10,f_K with K as the number of classes in your dataset, or gru_10_0,f_K to use matrix edge filters instead of vectors (only use matrices when your data set is quite large, and with many different point clouds, like S3DIS).

Datasets without RGB

If your data does not have RGB values you can easily use SPG. You will need to follow the instructions in partition/partition.ply regarding the pruning. You will need to adapt the /learning/custom_dataset.py file so that it does not refer ro RGB values. You should absolutely not use a model pretrained on values with RGB. instead, retrain a model from scratch using the --pc_attribs xyzelpsv option to remove RGB from the shape embedding input.

Citation

If you use the semantic segmentation module (code in /learning), please cite:
Large-scale Point Cloud Semantic Segmentation with Superpoint Graphs, Loic Landrieu and Martin Simonovski, CVPR, 2018.

If you use the learned partition module (code in /supervized_partition), please cite:
Point Cloud Oversegmentation with Graph-Structured Deep Metric Learning, Loic Landrieu and Mohamed Boussaha CVPR, 2019.

To refer to the handcrafted partition (code in /partition) step specifically, refer to:
Weakly Supervised Segmentation-Aided Classification of Urban Scenes from 3D LiDAR Point Clouds, StΓ©phane Guinard and Loic Landrieu. ISPRS Workshop, 2017.

To refer to the L0-cut pursuit algorithm (code in github.com/loicland/cut-pursuit) specifically, refer to:
Cut Pursuit: Fast Algorithms to Learn Piecewise Constant Functions on General Weighted Graphs, Loic Landrieu and Guillaume Obozinski, SIAM Journal on Imaging Sciences, 2017

To refer to pytorch geometric implementation, see their bibtex in their repo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].