# Pytorch Implementation of PointNet and PointNet++
This repo is implementation for [PointNet](http://openaccess.thecvf.com/content_cvpr_2017/papers/Qi_PointNet_Deep_Learning_CVPR_2017_paper.pdf) and [PointNet++](http://papers.nips.cc/paper/7095-pointnet-deep-hierarchical-feature-learning-on-point-sets-in-a-metric-space.pdf) in pytorch.
## Update
**2021/03/27:**
(1) Release pre-trained models for semantic segmentation, where PointNet++ can achieve **53.5\%** mIoU.
(2) Release pre-trained models for classification and part segmentation in `log/`.
**2021/03/20:** Update codes for classification, including:
(1) Add codes for training **ModelNet10** dataset. Using setting of ``--num_category 10``.
(2) Add codes for running on CPU only. Using setting of ``--use_cpu``.
(3) Add codes for offline data preprocessing to accelerate training. Using setting of ``--process_data``.
(4) Add codes for training with uniform sampling. Using setting of ``--use_uniform_sample``.
**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.
## Install
The latest codes are tested on Ubuntu 16.04, CUDA10.1, PyTorch 1.6 and Python 3.7:
```shell
conda install pytorch==1.6.0 cudatoolkit=10.1 -c pytorch
```
## Classification (ModelNet10/40)
### Data Preparation
Download alignment **ModelNet** [here](https://shapenet.cs.stanford.edu/media/modelnet40_normal_resampled.zip) and save in `data/modelnet40_normal_resampled/`.
### Run
You can run different modes with following codes.
* If you want to use offline processing of data, you can use `--process_data` in the first run. You can download pre-processd data [here](https://drive.google.com/drive/folders/1_fBYbDO3XSdRt3DSbEBe41r5l9YpIGWF?usp=sharing) and save it in `data/modelnet40_normal_resampled/`.
* If you want to train on ModelNet10, you can use `--num_category 10`.
```shell
# ModelNet40
## Select different models in ./models
## e.g., pointnet2_ssg without normal features
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 with normal features
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 with uniform sampling
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
## Similar setting like ModelNet40, just using --num_category 10
## e.g., pointnet2_ssg without normal features
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
```
### 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 (ShapeNet)
### Data Preparation
Download alignment **ShapeNet** [here](https://shapenet.cs.stanford.edu/media/shapenetcore_partanno_segmentation_benchmark_v0_normal.zip) 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 (S3DIS)
### Data Preparation
Download 3D indoor parsing dataset (**S3DIS**) [here](http://buildingparser.stanford.edu/dataset.html) and save in `data/s3dis/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](http://www.meshlab.net/).
### Performance
|Model | Overall Acc |Class avg IoU | Checkpoint
|--|--|--|--|
| PointNet (Pytorch) | 78.9 | 43.7| [40.7MB](log/sem_seg/pointnet_sem_seg) |
| PointNet2_ssg (Pytorch) | **83.0** | **53.5**| [11.2MB](log/sem_seg/pointnet2_sem_seg) |
## Visualization
### Using show3d_balls.py
```
## build C++ code for visualization
cd visualizer
bash build.sh
## run one example
python show3d_balls.py
```
![](/visualizer/pic.png)
### Using MeshLab
![](/visualizer/pic2.png)
## Reference By
[halimacc/pointnet3](https://github.com/halimacc/pointnet3)<br>
[fxia22/pointnet.pytorch](https://github.com/fxia22/pointnet.pytorch)<br>
[charlesq34/PointNet](https://github.com/charlesq34/pointnet) <br>
[charlesq34/PointNet++](https://github.com/charlesq34/pointnet2)
## Citation
If you find this repo useful in your research, please consider citing it and our other works:
```
@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}
}
```
```
@InProceedings{yan20222dpass,
title={2DPASS: 2D Priors Assisted Semantic Segmentation on LiDAR Point Clouds},
author={Xu Yan and Jiantao Gao and Chaoda Zheng and Chao Zheng and Ruimao Zhang and Shuguang Cui and Zhen Li},
year={2022},
journal={ECCV}
}
```
## Selected Projects using This Codebase
* [PointConv: Deep Convolutional Networks on 3D Point Clouds, CVPR'19](https://github.com/Young98CN/pointconv_pytorch)
* [On Isometry Robustness of Deep 3D Point Cloud Models under Adversarial Attacks, CVPR'20](https://github.com/skywalker6174/3d-isometry-robust)
* [Label-Efficient Learning on Point Clouds using Approximate Convex Decompositions, ECCV'20](https://github.com/matheusgadelha/PointCloudLearningACD)
* [PCT: Point Cloud Transformer](https://github.com/MenghaoGuo/PCT)
* [PSNet: Fast Data Structuring for Hierarchical Deep Learning on Point Cloud](https://github.com/lly007/PointStructuringNet)
* [Stratified Transformer for 3D Point Cloud Segmentation, CVPR'22](https://github.com/dvlab-research/stratified-transformer)
没有合适的资源?快使用搜索试试~ 我知道了~
PointNet和PointNet++的Pytorch实现
共81个文件
py:47个
txt:16个
pth:10个
需积分: 39 32 下载量 2 浏览量
2022-08-31
18:14:08
上传
评论 6
收藏 130.98MB RAR 举报
温馨提示
更新 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文件,方便使用。
资源详情
资源评论
资源推荐
收起资源包目录
Pointnet_Pointnet2_pytorch-master.rar (81个子文件)
Pointnet_Pointnet2_pytorch-master
Pointnet_Pointnet2_pytorch-master
visualizer
pc_utils.py 7KB
show3d_balls.py 8KB
pic.png 315KB
eulerangles.py 13KB
pic2.png 589KB
render_balls_so.cpp 1KB
plyfile.py 26KB
build.sh 102B
models
pointnet2_sem_seg_msg.py 2KB
pointnet2_part_seg_ssg.py 2KB
pointnet2_part_seg_msg.py 2KB
pointnet_utils.py 4KB
pointnet2_sem_seg.py 2KB
pointnet2_cls_ssg.py 2KB
pointnet2_cls_msg.py 2KB
pointnet_sem_seg.py 2KB
pointnet2_utils.py 11KB
pointnet_part_seg.py 3KB
pointnet_cls.py 1KB
log
classification
pointnet2_ssg_wo_normals
logs
pointnet2_cls_ssg.txt 29KB
pointnet2_cls_ssg.py 2KB
checkpoints
best_model.pth 16.97MB
pointnet2_utils.py 11KB
pointnet2_msg_normals
logs
pointnet2_cls_msg.txt 70KB
pointnet2_cls_msg.py 2KB
checkpoints
best_model.pth 20.15MB
pointnet2_utils.py 11KB
part_seg
pointnet2_part_seg_msg
logs
pointnet2_part_seg_msg.txt 196KB
pointnet2_part_seg_msg.py 2KB
checkpoints
best_model.pth 20.09MB
pointnet2_utils.py 11KB
sem_seg
pointnet2_sem_seg
logs
pointnet2_sem_seg.txt 58KB
pointnet2_sem_seg.py 2KB
checkpoints
best_model.pth 11.22MB
eval.txt 6KB
pointnet2_utils.py 11KB
pointnet_sem_seg
logs
pointnet_sem_seg.txt 197KB
pointnet_sem_seg.py 2KB
checkpoints
best_model.pth 40.52MB
eval.txt 6KB
pointnet2_utils.py 11KB
log - 副本
classification
pointnet2_ssg_wo_normals
logs
pointnet2_cls_ssg.txt 29KB
pointnet2_cls_ssg.py 2KB
checkpoints
best_model.pth 16.97MB
pointnet2_utils.py 11KB
pointnet2_msg_normals
logs
pointnet2_cls_msg.txt 70KB
pointnet2_cls_msg.py 2KB
checkpoints
best_model.pth 20.15MB
pointnet2_utils.py 11KB
part_seg
pointnet2_part_seg_msg
logs
pointnet2_part_seg_msg.txt 196KB
pointnet2_part_seg_msg.py 2KB
checkpoints
best_model.pth 20.09MB
pointnet2_utils.py 11KB
sem_seg
pointnet2_sem_seg
logs
pointnet2_sem_seg.txt 58KB
pointnet2_sem_seg.py 2KB
checkpoints
best_model.pth 11.22MB
eval.txt 6KB
pointnet2_utils.py 11KB
pointnet_sem_seg
logs
pointnet_sem_seg.txt 197KB
pointnet_sem_seg.py 2KB
checkpoints
best_model.pth 40.52MB
eval.txt 6KB
pointnet2_utils.py 11KB
provider.py 10KB
test_semseg.py 9KB
train_semseg.py 13KB
data_utils
indoor3d_util.py 24KB
collect_indoor3d_data.py 901B
ShapeNetDataLoader.py 5KB
S3DISDataLoader.py 10KB
ModelNetDataLoader.py 5KB
meta
class_names.txt 83B
anno_paths.txt 8KB
LICENSE 1KB
test_classification.py 4KB
train_classification.py 9KB
train_partseg.py 13KB
.gitignore 1KB
README.md 8KB
.gitattributes 66B
test_partseg.py 7KB
共 81 条
- 1
拉姆哥的小屋
- 粉丝: 6113
- 资源: 132
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0