1 Star 0 Fork 1

AI-Models-CN/Pointnet_Pointnet2_pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

PointNet 与 PointNet++ 的 PyTorch 实现

这个仓库是PointNetPointNet++ 的 PyTorch 实现。

更新

2021/03/27:

(1) 为语义分割发布预训练模型,其中 PointNet++ 可以获得 53.5% mIoU.

(2) 发布分类和部件分割的预训练模型在 log/ 目录中

2021/03/20: 更新用于分类的代码

(1) 增加代码用于训练 ModelNet10 数据集,使用配置 --num_category 10.

(2) 增强代码用于在 CPU 上执行,使用配置 --use_cpu.

(3) 增加代码用于离线数据处理,加快训练速度,使用配置 --process_data.

(4) 增加代码用于训练均匀采样,使用配置 --use_uniform_sample.

2019/11/26:

(1) 修改先前代码中的部分错误,增加数据增强的技巧。现在分类仅通过1024个点就可以得到 92.8%!

(2) 增加测试代码,包括分类和分割,以及语义分割的可视化。

(3) 组织所有的模型到 ./models 目录中方便使用。

安装

最新代码测试在 Ubuntu 16.04, CUDA10.1, PyTorch 1.6 and Python 3.7:

conda install pytorch==1.6.0 cudatoolkit=10.1 -c pytorch

分类 (ModelNet10/40)

数据准备(分类)

下载对齐数据 ModelNet here 并且保存在 data/modelnet40_normal_resampled/.

运行(分类)

下面的代码可以运行在不同的模式下:

  • 如果需要离线处理数据,可以在第一次运行时使用 --process_data 。也可以下载预处理数据 here 并且保存在 data/modelnet40_normal_resampled/.
  • 如果需要训练 ModelNet10,可以使用 --num_category 10.
# ModelNet40
## Select different models in ./models 

## e.g., pointnet2_ssg 没有法向特征
python train_classification.py --model pointnet2_cls_ssg --log_dir pointnet2_cls_ssg
python test_classification.py --log_dir pointnet2_cls_ssg

## e.g., pointnet2_ssg 增加法向特征
python train_classification.py --model pointnet2_cls_ssg --use_normals --log_dir pointnet2_cls_ssg_normal
python test_classification.py --use_normals --log_dir pointnet2_cls_ssg_normal

## e.g., pointnet2_ssg 基于均匀采样
python train_classification.py --model pointnet2_cls_ssg --use_uniform_sample --log_dir pointnet2_cls_ssg_fps
python test_classification.py --use_uniform_sample --log_dir pointnet2_cls_ssg_fps

# ModelNet10
## 与 ModelNet40 的配置相同,仅使用 --num_category 10

## e.g., pointnet2_ssg 没有法向特征
python train_classification.py --model pointnet2_cls_ssg --log_dir pointnet2_cls_ssg --num_category 10
python test_classification.py --log_dir pointnet2_cls_ssg --num_category 10

性能(分类)

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

部件分割 (ShapeNet)

数据准备(部件分割)

下载对齐的数据 ShapeNet here
保存在 data/shapenetcore_partanno_segmentation_benchmark_v0_normal/.

执行(部件分割)

## 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

性能(部件分割)

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

语义分割 (S3DIS)

数据准备(语义分割)

下载三维室内解析数据集 ( 3D indoor parsing dataset,S3DIS) here
保存在 data/s3dis/Stanford3dDataset_v1.2_Aligned_Version/.

cd data_utils
python collect_indoor3d_data.py

处理数据保存在 data/s3dis/stanford_indoor3d/.

执行(语义分割)

## 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

可视化结果保存在 log/sem_seg/pointnet2_sem_seg/visual/ 并且可以使用 MeshLab 可视化 .obj 文件

性能(语义分割)

Model Overall Acc Class avg IoU Checkpoint
PointNet (Pytorch) 78.9 43.7 40.7MB
PointNet2_ssg (Pytorch) 83.0 53.5 11.2MB

可视化

使用 show3d_balls.py

## build C++ code for visualization
cd visualizer
bash build.sh 
## run one example 
python show3d_balls.py

可视化结果

使用 MeshLab

可视化结果

参考文献

  1. halimacc/pointnet3
  2. fxia22/pointnet.pytorch
  3. charlesq34/PointNet
  4. charlesq34/PointNet++

引用

如果这个仓库在你的研究中有用,请考虑引用:

@article{Pytorch_Pointnet_Pointnet2,
      Author = {Xu Yan},
      Title = {Pointnet/Pointnet++ Pytorch},
      Journal = {https://github.com/yanx27/Pointnet_Pointnet2_pytorch},
      Year = {2019}
}
@InProceedings{yan2020pointasnl,
  title={PointASNL: Robust Point Clouds Processing using Nonlocal Neural Networks with Adaptive Sampling},
  author={Yan, Xu and Zheng, Chaoda and Li, Zhen and Wang, Sheng and Cui, Shuguang},
  journal={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2020}
}
@InProceedings{yan2021sparse,
  title={Sparse Single Sweep LiDAR Point Cloud Segmentation via Learning Contextual Shape Priors from Scene Completion},
  author={Yan, Xu and Gao, Jiantao and Li, Jie and Zhang, Ruimao, and Li, Zhen and Huang, Rui and Cui, Shuguang},
  journal={AAAI Conference on Artificial Intelligence ({AAAI})},
  year={2021}
}

使用这个代码库选择项目

MIT License Copyright (c) 2019 benny Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

PointNet 与 PointNet++ 的标准实现,及中文化注释。 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ai-models-cn/Pointnet_Pointnet2_pytorch.git
git@gitee.com:ai-models-cn/Pointnet_Pointnet2_pytorch.git
ai-models-cn
Pointnet_Pointnet2_pytorch
Pointnet_Pointnet2_pytorch
cn-pytorch1.8.0

搜索帮助