PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation

Overview

PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation

Created by Charles R. Qi, Hao Su, Kaichun Mo, Leonidas J. Guibas from Stanford University.

prediction example

Introduction

This work is based on our arXiv tech report, which is going to appear in CVPR 2017. We proposed a novel deep net architecture for point clouds (as unordered point sets). You can also check our project webpage for a deeper introduction.

Point cloud is an important type of geometric data structure. Due to its irregular format, most researchers transform such data to regular 3D voxel grids or collections of images. This, however, renders data unnecessarily voluminous and causes issues. In this paper, we design a novel type of neural network that directly consumes point clouds, which well respects the permutation invariance of points in the input. Our network, named PointNet, provides a unified architecture for applications ranging from object classification, part segmentation, to scene semantic parsing. Though simple, PointNet is highly efficient and effective.

In this repository, we release code and data for training a PointNet classification network on point clouds sampled from 3D shapes, as well as for training a part segmentation network on ShapeNet Part dataset.

Citation

If you find our work useful in your research, please consider citing:

@article{qi2016pointnet,
  title={PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation},
  author={Qi, Charles R and Su, Hao and Mo, Kaichun and Guibas, Leonidas J},
  journal={arXiv preprint arXiv:1612.00593},
  year={2016}
}

Installation

Install TensorFlow. You may also need to install h5py. The code has been tested with Python 2.7, TensorFlow 1.0.1, CUDA 8.0 and cuDNN 5.1 on Ubuntu 14.04.

If you are using PyTorch, you can find a third-party pytorch implementation here.

To install h5py for Python:

sudo apt-get install libhdf5-dev
sudo pip install h5py

Usage

To train a model to classify point clouds sampled from 3D shapes:

python train.py

Log files and network parameters will be saved to log folder in default. Point clouds of ModelNet40 models in HDF5 files will be automatically downloaded (416MB) to the data folder. Each point cloud contains 2048 points uniformly sampled from a shape surface. Each cloud is zero-mean and normalized into an unit sphere. There are also text files in data/modelnet40_ply_hdf5_2048 specifying the ids of shapes in h5 files.

To see HELP for the training script:

python train.py -h

We can use TensorBoard to view the network architecture and monitor the training progress.

tensorboard --logdir log

After the above training, we can evaluate the model and output some visualizations of the error cases.

python evaluate.py --visu

Point clouds that are wrongly classified will be saved to dump folder in default. We visualize the point cloud by rendering it into three-view images.

If you'd like to prepare your own data, you can refer to some helper functions in utils/data_prep_util.py for saving and loading HDF5 files.

Part Segmentation

To train a model for object part segmentation, firstly download the data:

cd part_seg
sh download_data.sh

The downloading script will download ShapeNetPart dataset (around 1.08GB) and our prepared HDF5 files (around 346MB).

Then you can run train.py and test.py in the part_seg folder for training and testing (computing mIoU for evaluation).

License

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

Selected Projects that Use PointNet

Comments
  • how to visualize the segmentation results

    how to visualize the segmentation results

    thanks for sharing this work. I am new to semantic segmentation, can you tell me how to visualize the results and the raw point clouds? Thank you very much!

    opened by heng94 23
  • Problems in predicting own data in sem seg

    Problems in predicting own data in sem seg

    Please check the edit history for the modified script, they have been deleted for the reading convenience. Please DO NOT reply to this topic again!

    • I modified the script as follow to process my own data:

      1. I use text file as input, not npy file. But the data forms are same in .txt and .npy.

      2. There is no label for my own data, so those relevant lines in the scripts were deleted.

        I think these changes should not affect the function of the model, however the result was totally wrong.

    • The form of data like:

    -0.00650059 49.97880156 -125.81439983 254 254 254
    -0.02650009 49.97840101 -125.81430065 251 251 251
    -0.01760040 49.99639875 -125.81469738 246 246 246
    0.00240005 49.99739820 -125.81400311 248 248 248
    -0.01719986 49.96049864 -125.81439983 252 252 252
    0.01370014 49.98089964 -125.81479656 255 255 255
    0.00600018 49.96239836 -125.81449902 251 251 251
    

    The previous 3 columns are XYZ, the rest are RGB (not true color but grey value).

    • The seg result is totally wrong:

    0.559700 47.716499 -126.147400 139 139 139 1.000000 0
    0.592000 47.458698 -127.404404 67 67 67 1.000000 0
    0.013400 47.426899 -126.498901 148 148 148 1.000000 0
    0.274700 47.592098 -125.803002 200 200 200 1.000000 0
    0.966400 47.919499 -126.439301 157 157 157 1.000000 0
    0.876899 47.995201 -128.726700 132 132 132 1.000000 0
    0.422400 47.648601 -126.555298 85 85 85 1.000000 0
    0.152500 47.502899 -126.407097 155 155 155 1.000000 0
    

    All points were classified as class 0, and the probabilities given were 1. Can't figure out the reason.

    opened by RollingIsland 21
  • issue on win10

    issue on win10

    When I run the source code, i met the following question:

    File "D:\pointnet\trunk\provider.py", line 88, in getDataFiles return [line.rstrip() for line in open(list_filename)] FileNotFoundError: [Errno 2] No such file or directory: 'D:\pointnet.git\trunk\data/modelnet40_ply_hdf5_2048/train_files.txt'

    Any one knows the reason?

    opened by ypLincode 14
  • sem_seg learning rate clip typo

    sem_seg learning rate clip typo

    Dear Charles,

    In sem_seg/train.py probably a typo which eliminates your learning rate clipping, which you so emphasize.

    learing_rate should be learning_rate?

    def get_learning_rate(batch):
    --
    def get_learning_rate(batch):
        learning_rate = tf.train.exponential_decay(
                            BASE_LEARNING_RATE,  # Base learning rate.
                            batch * BATCH_SIZE,  # Current index into the dataset.
                            DECAY_STEP,          # Decay step.
                            DECAY_RATE,          # Decay rate.
                            staircase=True)
        learing_rate = tf.maximum(learning_rate, 0.00001) # CLIP THE LEARNING RATE!!
        return learning_rate
    
    opened by themmes 14
  • Confusion to create .h5 file for multi dimensional features

    Confusion to create .h5 file for multi dimensional features

    Dear Author, I am trying to use PointNet for my research to combine the random feature of the image obtained from the random slices. I am planning to use 50*600 size features per image. Here, 50 means the number of slices of the image and 600 means the size of features. I want to get a single aggregated feature representing an image. Is it possible from your network? Another confusion is, how to prepare a data .h5 similar to yours? It would be wonderful if you suggested me some ideas. Thanks

    opened by csitaula 13
  • About the outdoor scene point cloud segmentation problem

    About the outdoor scene point cloud segmentation problem

    Hi! I have learned this repository for a long time, and I would like to use the pointnet to solve the problem of point cloud classification in outdoor scenes. I've got some results: 10___10___area6____________ The picture above is the result of urban street point cloud segmentation and I am satisfied with this result. So I would like to try a larger outdoor scene point cloud segmentation. I got some outdoor scene point cloud dataset, and each of them is about 1.2G. I manually divided them into some categories. Just like this: 2017-11-12 20_07_18____________

    Follow this repo's step, I converted the classified point cloud data into .npy format, according to collect_indoor3d_data.py 2017-11-12 20_08_28____________ Than I try to converted these .npy data into hdf5 format by executing gen_indoor3d_h5.py. And the total data converted to 4.2G.(NUM_POINT=4096, H5_BATCH_SIZE=1000) 2017-11-12 20_05_53____________ I've tried to train these data, and the corresponding training file parameters are here(train.py): 2017-11-12 20_06_40____________ BUT , I always got this kind of error, and I can't go on with the training 2017-11-12 20_05_08____________ 2345 20171112210729

    (IndexError: index 89000 is out of bounds for axis 0 with size 89000) I've tried to tune some parameters(batch_size ,H5_BATCH_SIZE) but it didn't work. Could you please help me to solve this problem? I am looking forward to hearing from you soon. Thank a lot!!

    opened by luoxiaoliaolan 11
  • about segmentation network

    about segmentation network

    Hi! Thanks for sharing your nice works. I wonder why the segmentation network need to concatenate the one hot label with the pooling feature, will remove the encoded label decrease the performance? Thanks. @charlesq34

    opened by touristCheng 11
  • Adding RGB Data?

    Adding RGB Data?

    Are there any plans to incorporate RGB information into the network. Have you tried to incorporate normal data into the network, rather than it predicting it?

    Also, does your algorithm work on inconsistent sampling? For example, if i have a box point cloud, but the areas with lower curvature (flat parts) are downsampled much more than those with more curvature (intersection points) in order to conserve space/memory

    opened by soulslicer 10
  • Questions about ModelNet40 point clouds data

    Questions about ModelNet40 point clouds data

    Excellent work! Thank you very much.

    I have two questions about the point clouds data you provide:

    (1) How could you generate fixed size(1024,2^10) point cloud from mesh file? I try to use ray casting to generate, but it does not produce num of points equal to power of 2

    (2) For each point could, I notice the first half part(0-1023) and the second half part(1024-2047) are identical Does it still meaningful to train pointnet with 2048 as num_point ?

    opened by godspeed1989 9
  • Training time for part segmentation model

    Training time for part segmentation model

    Thank you for your great work. I did all step as you wrote. No error here howerver the training for part segmentation model (cmd: python train.py) is taking too much time. I don't know why because My computer has 32G memory, has GPU. I think I did forgot anything. Please help me! Best, Aki

    opened by Aki1987 8
  • Bug in training/evaluation: some data missed

    Bug in training/evaluation: some data missed

    Dear authors,

    I have noticed that for training/evaluation (https://github.com/charlesq34/pointnet/blob/master/train.py#L187) you iterate over the whole number of batches. However, for the number of instances not divisible by batch_size this would result in the fact that some instances are never seen for training or evaluation. For example, for M40 train size=9840, test size=2468. These are not divisible by default batch size of 32, which means you miss out 4 instances for testing and 16 instances for training. This can have dramatic consequences for much larger batch sizes (which make sense for GPUs with large amount of RAM).

    If you confirm this, I can create a pull request, which fixes this problem.

    Best Dmytro Bobkov

    opened by DBobkov 8
  • Isn't this section incorrect?

    Isn't this section incorrect?

    https://github.com/charlesq34/pointnet/blob/539db60eb63335ae00fe0da0c8e38c791c764d2b/models/transform_nets.py#L83

    You set the weights and bias to zero. Then matmul.

    Hence you will always have zero updates to the TNet that is prior.

    opened by mathephysicist 1
  • Annotation

    Annotation

    Hi, is there anyone know how to annotate the point cloud? I am planning to use my own dataset and currently stuck at the first phase. I run the collect_indoor3d_data.py but for data preparation it seems that I need to provide data annotations. Is this necessary? if yes, how can I annotate my data? My data is in ply format and las format. Thanks for your reply.

    opened by Sassimion 1
  • Issued certificate has expired

    Issued certificate has expired

    python train.py
    2022-06-07 21:59:38.800774: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: 2022-06-07 21:59:38.800816: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. --2022-06-07 21:59:39-- https://shapenet.cs.stanford.edu/media/modelnet40_ply_hdf5_2048.zip Resolving shapenet.cs.stanford.edu (shapenet.cs.stanford.edu)... 171.67.77.19 Connecting to shapenet.cs.stanford.edu (shapenet.cs.stanford.edu)|171.67.77.19|:443... connected. ERROR: cannot verify shapenet.cs.stanford.edu's certificate, issued by ‘CN=InCommon RSA Server CA,OU=InCommon,O=Internet2,L=Ann Arbor,ST=MI,C=US’: Issued certificate has expired. To connect to shapenet.cs.stanford.edu insecurely, use `--no-check-certificate'. unzip: cannot find or open modelnet40_ply_hdf5_2048.zip, modelnet40_ply_hdf5_2048.zip.zip or modelnet40_ply_hdf5_2048.zip.ZIP. mv: cannot stat 'modelnet40_ply_hdf5_2048': No such file or directory

    opened by dawei91 1
  • PointNet for angle regression

    PointNet for angle regression

    Hey Charles, how are you doing? Hope you're well.

    Let me ask you: is there a way to use PointNet for regressing the rotation angles from an original position to a canon position?

    Thanks in advance!

    opened by matfcp 0
Owner
Charles R. Qi
AI Researcher. PhD from Stanford University. Focus: deep learning, computer vision and 3D.
Charles R. Qi
pytorch implementation for PointNet

PointNet.pytorch This repo is implementation for PointNet in pytorch. The model is in pointnet/model.py. It is teste

Fei Xia 1.7k Dec 30, 2022
PyTorch implementation of Pointnet2/Pointnet++

Pointnet2/Pointnet++ PyTorch Project Status: Unmaintained. Due to finite time, I have no plans to update this code and I will not be responding to iss

Erik Wijmans 1.2k Dec 29, 2022
Point Cloud Denoising input segmentation output raw point-cloud valid/clear fog rain de-noised Abstract Lidar sensors are frequently used in environme

Point Cloud Denoising input segmentation output raw point-cloud valid/clear fog rain de-noised Abstract Lidar sensors are frequently used in environme

null 75 Nov 24, 2022
Unofficial implementation of Point-Unet: A Context-Aware Point-Based Neural Network for Volumetric Segmentation

Point-Unet This is an unofficial implementation of the MICCAI 2021 paper Point-Unet: A Context-Aware Point-Based Neural Network for Volumetric Segment

Namt0d 9 Dec 7, 2022
A light-weight image labelling tool for Python designed for creating segmentation data sets.

An image labelling tool for creating segmentation data sets, for Django and Flask.

null 117 Nov 21, 2022
Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral)

Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral) This is the official implementat

Yifan Zhang 259 Dec 25, 2022
GndNet: Fast ground plane estimation and point cloud segmentation for autonomous vehicles using deep neural networks.

GndNet: Fast Ground plane Estimation and Point Cloud Segmentation for Autonomous Vehicles. Authors: Anshul Paigwar, Ozgur Erkent, David Sierra Gonzale

Anshul Paigwar 114 Dec 29, 2022
Style-based Point Generator with Adversarial Rendering for Point Cloud Completion (CVPR 2021)

Style-based Point Generator with Adversarial Rendering for Point Cloud Completion (CVPR 2021) An efficient PyTorch library for Point Cloud Completion.

Microsoft 119 Jan 2, 2023
Implementation of the "PSTNet: Point Spatio-Temporal Convolution on Point Cloud Sequences" paper.

PSTNet: Point Spatio-Temporal Convolution on Point Cloud Sequences Introduction Point cloud sequences are irregular and unordered in the spatial dimen

Hehe Fan 63 Dec 9, 2022
Code for "PV-RAFT: Point-Voxel Correlation Fields for Scene Flow Estimation of Point Clouds", CVPR 2021

PV-RAFT This repository contains the PyTorch implementation for paper "PV-RAFT: Point-Voxel Correlation Fields for Scene Flow Estimation of Point Clou

Yi Wei 43 Dec 5, 2022
Implementation of the "Point 4D Transformer Networks for Spatio-Temporal Modeling in Point Cloud Videos" paper.

Point 4D Transformer Networks for Spatio-Temporal Modeling in Point Cloud Videos Introduction Point cloud videos exhibit irregularities and lack of or

Hehe Fan 101 Dec 29, 2022
Synthetic LiDAR sequential point cloud dataset with point-wise annotations

SynLiDAR dataset: Learning From Synthetic LiDAR Sequential Point Cloud This is official repository of the SynLiDAR dataset. For technical details, ple

null 78 Dec 27, 2022
[ICCV 2021 Oral] SnowflakeNet: Point Cloud Completion by Snowflake Point Deconvolution with Skip-Transformer

This repository contains the source code for the paper SnowflakeNet: Point Cloud Completion by Snowflake Point Deconvolution with Skip-Transformer (ICCV 2021 Oral). The project page is here.

AllenXiang 65 Dec 26, 2022
Point-NeRF: Point-based Neural Radiance Fields

Point-NeRF: Point-based Neural Radiance Fields Project Sites | Paper | Primary c

Qiangeng Xu 662 Jan 1, 2023
Molecular Sets (MOSES): A benchmarking platform for molecular generation models

Molecular Sets (MOSES): A benchmarking platform for molecular generation models Deep generative models are rapidly becoming popular for the discovery

Neelesh C A 3 Oct 14, 2022
Molecular Sets (MOSES): A Benchmarking Platform for Molecular Generation Models

Molecular Sets (MOSES): A benchmarking platform for molecular generation models Deep generative models are rapidly becoming popular for the discovery

MOSES 656 Dec 29, 2022
Blender Add-on that sets a Material's Base Color to one of Pantone's Colors of the Year

Blender PCOY (Pantone Color of the Year) MCMC (Mid-Century Modern Colors) HG71 (House & Garden Colors 1971) Blender Add-ons That Assign a Custom Color

Don Schnitzius 15 Nov 20, 2022
Official Code for ICML 2021 paper "Revisiting Point Cloud Shape Classification with a Simple and Effective Baseline"

Revisiting Point Cloud Shape Classification with a Simple and Effective Baseline Ankit Goyal, Hei Law, Bowei Liu, Alejandro Newell, Jia Deng Internati

Princeton Vision & Learning Lab 115 Jan 4, 2023
Code for the paper "Benchmarking and Analyzing Point Cloud Classification under Corruptions"

ModelNet-C Code for the paper "Benchmarking and Analyzing Point Cloud Classification under Corruptions". For the latest updates, see: sites.google.com

Jiawei Ren 45 Dec 28, 2022