Pytorch Implementation of PointNet and PointNet++
This repo is implementation for PointNet and PointNet++ in pytorch.
Update
2019/11/26:
(1) Fixed some errors in previous codes and added data augmentation tricks. Now classification by only 1024 points can achieve 92.8%!
(2) Added testing codes, including classification and segmentation, and semantic segmentation with visualization.
(3) Organized all models into ./models files for easy using.
Classification
Data Preparation
Download alignment ModelNet here and save in data/modelnet40_normal_resampled/.
Run
## Check model in ./models
## E.g. pointnet2_msg
python train_cls.py --model pointnet2_cls_msg --normal --log_dir pointnet2_cls_msg
python test_cls.py --normal --log_dir pointnet2_cls_msg
Performance
Model
Accuracy
PointNet (Official)
89.2
PointNet2 (Official)
91.9
PointNet (Pytorch without normal)
90.6
PointNet (Pytorch with normal)
91.4
PointNet2_SSG (Pytorch without normal)
92.2
PointNet2_SSG (Pytorch with normal)
92.4
PointNet2_MSG (Pytorch with normal)
92.8
Part Segmentation
Data Preparation
Download alignment ShapeNet here and save in data/shapenetcore_partanno_segmentation_benchmark_v0_normal/.
Run
## Check model in ./models
## E.g. pointnet2_msg
python train_partseg.py --model pointnet2_part_seg_msg --normal --log_dir pointnet2_part_seg_msg
python test_partseg.py --normal --log_dir pointnet2_part_seg_msg
Performance
Model
Inctance avg IoU
Class avg IoU
PointNet (Official)
83.7
80.4
PointNet2 (Official)
85.1
81.9
PointNet (Pytorch)
84.3
81.1
PointNet2_SSG (Pytorch)
84.9
81.8
PointNet2_MSG (Pytorch)
85.4
82.5
Semantic Segmentation
Data Preparation
Download 3D indoor parsing dataset (S3DIS) here and save in data/Stanford3dDataset_v1.2_Aligned_Version/.
cd data_utils
python collect_indoor3d_data.py
Processed data will save in data/stanford_indoor3d/.
Run
## Check model in ./models
## E.g. pointnet2_ssg
python train_semseg.py --model pointnet2_sem_seg --test_area 5 --log_dir pointnet2_sem_seg
python test_semseg.py --log_dir pointnet2_sem_seg --test_area 5 --visual
Visualization results will save in log/sem_seg/pointnet2_sem_seg/visual/ and you can visualize these .obj file by MeshLab.
Performance on sub-points of raw dataset (processed by official PointNet Link)
Model
Class avg IoU
PointNet (Official)
41.1
PointNet (Pytorch)
48.9
PointNet2 (Official)
N/A
PointNet2_ssg (Pytorch)
53.2
Performance on raw dataset
still on testing...
Visualization
Using show3d_balls.py
## build C++ code for visualization
cd visualizer
bash build.sh
## run one example
python show3d_balls.py
Using MeshLab
Reference By
Environments
Ubuntu 16.04
Python 3.6.7
Pytorch 1.1.0