Code Monkey home page Code Monkey logo

elgs's Introduction

Exploiting Local and Global Structure for Point Cloud Semantic Segmentation with Contextual Point Representations

Code for the paper: Exploiting Local and Global Structure for Point Cloud Semantic Segmentation with Contextual Point Representations

Introduction

we propose one novel model for point cloud semantic segmentation, which exploit the local and global structures within the point cloud based on the contextual point representations. Specifically, we enrich each point representation by performing one novel gated fusion on the point itself and its contextual points. Afterwards, based on the enriched representation, we propose one novel graph pointnet module (GPM), relying on the graph attention block (GAB) to dynamically compose and update each point representation within the local point cloud structure. Finally, we resort to the spatial-wise and channel-wise attention strategies to exploit the point cloud global structure and thereby yield the semantic label for each point.

Data download and process

We provide the processed files, you can download S3DIS data here . To prepare your own S3DIS Dataset HDF5 files, refer to PointNet, you need to firstly download 3D indoor parsing dataset version 1.2 (S3DIS Dataset) and convert original data to data label files by

python collect_indoor3d_data.py

Finally run

python gen_indoor3d_h5.py

to downsampling and generate HDF5 files. You can change the number of points in the downsampling by modify this file.

Model Training and Testing

The code is tested under TensorFlow 1.9.0 GPU version, Python 2.7.5, CUDA 9.0 and cuDNN 7.6.0 on Ubuntu 16.04. Here are some dependencies.

  • tensorflow-gpu (1.9.0)
  • python (2.7)
  • h5py
  • numpy
  • sklearn

Compile TF operators

  1. Find your tensorflow include path and cuda installation path.
python
import tensorflow as tf
tf.__path__
  1. modify complie files: tf_grouping_compile.sh,tf_sampling_compile.shand tf_interpolate_compile.sh.
  2. Compile the shared libraries.
cd tf_ops/3d_interpolation
./ tf_interpolate_compile.sh

cd tf_ops/grouping
./ tf_grouping_compile.sh

cd tf_ops/sampling
./ tf_sampling_compile.sh

Refer to PointNet++ for more details.

Training

When you have finished download processed data files or have prepared HDF5 files by yourself, to fill in your data path in the train.py. Then start training by:

cd models
python train.py

For S3DIS dataset, we tested on the area 5 by default. To get 6-fold results, run:

for((i=1;i<=6;i++)) \
do \
  python train_areas.py   --test_area  ${i}  --log_dir log/Area${i}  > train_and_test_area${i}.out 2>&1	 \
done \

you will get six models, each one of them is trained on five areas and tested on the other area.

Testing

After training, you can test model by:

python test.py --ckpt  your_ckpt_file  --ckpt_meta your_meta_file

Note that the best_seg_model chosen by test.py is only depend on overall accuracy(OA), maybe mIoU value is not the highest. Because the overall accuracy is not necessarily proportional to the mean IoU. You can test all saved model by:

python test_all_models.py

The operation of segment rooms in test set is already included in this file. We use the area5 by default as the test set. You can modify it in your own code.

We provide our trained model. When you finish your Data Processing, you can test our model by:

python test.py --ckpt trained_model/best_seg_model.ckpt  --ckpt_meta trained_model/best_seg_model.ckpt.meta

Citation

@inproceedings{fly519,
  title={Exploiting Local and Global Structure for Point Cloud Semantic Segmentation with Contextual Point Representations},
  author={Xu Wang, Jingming He and Lin Ma},
  booktitle={NeurIPS},
  year={2019},
}

elgs's People

Contributors

fly519 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.