Giter Club home page Giter Club logo

pointcnn's Introduction

PointCNN: Convolution On X-Transformed Points

Created by Yangyan Li, Rui Bu, Mingchao Sun, Wei Wu, Xinhan Di, and Baoquan Chen.

Introduction

PointCNN is a simple and general framework for feature learning from point cloud, which refreshed five benchmark records in point cloud processing (as of Jan. 23, 2018), including:

  • classification accuracy on ModelNet40 (91.7%, with 1024 input points only)
  • segmentation part averaged IoU on ShapeNet Parts (82%)
  • segmentation mean IoU on S3DIS (66.2%,test on Area1)

See our preprint on arXiv (accepted to NeurIPS 2018) for more details.

Pretrained models can be downloaded from here.

Performance on Recent Benchmarks

PartNet: A Large-scale Benchmark for Fine-grained and Hierarchical Part-level 3D Object Understanding

ABC: A Big CAD Model Dataset For Geometric Deep Learning

Practical Applications

3D cities: Deep Learning in three-dimensional space (from Esri)

More Implementations

We highly welcome issues, rather than emails, for PointCNN related questions.

License

Our code is released under MIT License (see LICENSE file for details).

Code Organization

The core X-Conv and PointCNN architecture are defined in pointcnn.py.

The network/training/data augmentation hyper parameters for classification tasks are defined in pointcnn_cls, for segmentation tasks are defined in pointcnn_seg.

Explanation of X-Conv and X-DeConv Parameters

Take the xconv_params and xdconv_params from shapenet_x8_2048_fps.py for example:

xconv_param_name = ('K', 'D', 'P', 'C', 'links')
xconv_params = [dict(zip(xconv_param_name, xconv_param)) for xconv_param in
                [(8, 1, -1, 32 * x, []),
                 (12, 2, 768, 32 * x, []),
                 (16, 2, 384, 64 * x, []),
                 (16, 6, 128, 128 * x, [])]]

xdconv_param_name = ('K', 'D', 'pts_layer_idx', 'qrs_layer_idx')
xdconv_params = [dict(zip(xdconv_param_name, xdconv_param)) for xdconv_param in
                 [(16, 6, 3, 2),
                  (12, 6, 2, 1),
                  (8, 6, 1, 0),
                  (8, 4, 0, 0)]]

Each element in xconv_params is a tuple of (K, D, P, C, links), where K is the neighborhood size, D is the dilation rate, P is the representative point number in the output (-1 means all input points are output representative points), and C is the output channel number. The links are used for adding DenseNet style links, e.g., [-1, -2] will tell the current layer to receive inputs from the previous two layers. from Each element specifies the parameters of one X-Conv layer, and they are stacked to create a deep network.

Each element in xdconv_params is a tuple of (K, D, pts_layer_idx, qrs_layer_idx), where K and D have the same meaning as that in xconv_params, pts_layer_idx specifies the output of which X-Conv layer (from the xconv_params) will be the input of this X-DeConv layer, and qrs_layer_idx specifies the output of which X-Conv layer (from the xconv_params) will be forwarded and fused with the output of this X-DeConv layer. The P and C parameters of this X-DeConv layer is also determined by qrs_layer_idx. Similarly, each element specifies the parameters of one X-DeConv layer, and they are stacked to create a deep network.

PointCNN Usage

PointCNN is implemented and tested with Tensorflow 1.6 in python3 scripts. Tensorflow before 1.5 version is not recommended, because of API. It has dependencies on some python packages such as transforms3d, h5py, plyfile, and maybe more if it complains. Install these packages before the use of PointCNN.

If you can only use Tensorflow 1.5 because of OS factor(UBUNTU 14.04),please modify "isnan()" to "std::nan()" in "/usr/local/lib/python3.5/dist-packages/tensorflow/include/tensorflow/core/framework/numeric_types.h" line 49

Here we list the commands for training/evaluating PointCNN on classification and segmentation tasks on multiple datasets.

  • Classification

    • ModelNet40

    cd data_conversions
    python3 ./download_datasets.py -d modelnet
    cd ../pointcnn_cls
    ./train_val_modelnet.sh -g 0 -x modelnet_x3_l4
    
  • Segmentation

    We use farthest point sampling (the implementation from PointNet++) in segmentation tasks. Compile FPS before the training/evaluation:

    cd sampling
    bash tf_sampling_compile.sh
    
    • ShapeNet

    cd data_conversions
    python3 ./download_datasets.py -d shapenet_partseg
    python3 ./prepare_partseg_data.py -f ../../data/shapenet_partseg
    cd ../pointcnn_seg
    ./train_val_shapenet.sh -g 0 -x shapenet_x8_2048_fps -l load_ckpt
    ./test_shapenet.sh -g 0 -x shapenet_x8_2048_fps -l ../../models/seg/pointcnn_seg_shapenet_x8_2048_fps_xxxx/ckpts/iter-xxxxx -r 10
    cd ../evaluation
    python3 eval_shapenet_seg.py -g ../../data/shapenet_partseg/test_label -p ../../data/shapenet_partseg/test_data_pred_10 -a
    
    • S3DIS

    Please refer to data_conversions for downloading S3DIS, then:

    cd data_conversions
    python3 prepare_s3dis_label.py
    python3 prepare_s3dis_data.py
    python3 prepare_s3dis_filelists.py
    cd ../pointcnn_seg
    ./train_val_s3dis.sh -g 0 -x s3dis_x8_2048_fps -a 1 -l ckpt
    ./test_s3dis.sh -g 0 -x s3dis_x8_2048_fps -a 1 -l ../../models/seg/pointcnn_seg_s3dis_x8_2048_fps_xxxx/ckpts/iter-xxxxx -r 4
    cd ../evaluation
    此处已经改写为可直接运行
    python3 s3dis_merge.py -d <path to *_pred.h5>
    python3 s3dis_merge.py
    python3 eval_s3dis.py
    

I use a hidden marker file to note when prepare is finished to avoid re-processing. This cache can be invalidated by deleting the markers.

Please notice that these command just for Area 1 (specified by -a 1 option) validation. Results on other Areas can be computed by iterating -a option.

  • Tensorboard

    If you want to moniter your train step, we recommand you use following command
    cd <your path>/PointCNN
    tensorboard --logdir=../models/<seg/cls> <--port=6006>
    

pointcnn's People

Contributors

lebrongg avatar

Stargazers

Jizhimin avatar suyunzzz avatar

Watchers

James Cloos avatar paper2code - bot avatar

Forkers

nnu-gisa

pointcnn's Issues

请教一下FPS的搭建

您好,非常感谢您对PointCNN的整理,十分有帮助。有一个关于在pytgon环境下调用C++代码问题希望得到作者的指点。对于PointCNN使用了PointNet++中FPS的实现,但这个实现并不是python代码。请问新手应该查阅哪方面的内容才能上手使用,期待作者的回答,感谢。

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.