pointnet 代码复现
Posted jiangxiaoju
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pointnet 代码复现相关的知识,希望对你有一定的参考价值。
文章目录
一、环境准备
根据作者描述使用python2.7+tensorflow1.0.1+cuda8.0。在Ubuntu16.04中复现。
1. 配置cuda8.0+cudnn5.1
具体过程可参考网上教程
2. 配置python2.7+tensorflow1.0.1、
使用conda创建虚拟环境便于管理
conda create -n pointnet python=2.7 anaconda
进入虚拟环境。
source activate pointnet
安装tensorlfow1.0.1。
pip install tensorflow-gpu==1.0.1
如果网不好建议切换清华源下载。
pip install tensorflow-gpu==1.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
3. 一些必要的库
sudo apt-get install libhdf5-dev
sudo pip install h5py
如果你是使用conda虚拟环境,安装h5py可用下面代码
pip install h5py
二、数据集准备
代码一共有三个部分,分别是分类网络,和两个分割网络。每个部分都有各自对应的数据集
1. 点云分类数据集
代码检测不到数据会自动下载。
2. part_seg部分的数据集
cd part_seg
sh download_data.sh
3. sem_seg部分的数据集
cd sem_seg
sh download_data.sh
三、训练模型
三个模型均运行train.py文件即可
python train.py
分类网络,经过以上训练,可以评估模型并输出一些错误案例的可视化图像。
python python evaluate.py --visu
四、实验结果
1. 分类网络
训练log
**** EPOCH 249 ****
----0-----
mean loss: 0.073358
accuracy: 0.976074
----1-----
mean loss: 0.078584
accuracy: 0.966912
----2-----
mean loss: 0.067263
accuracy: 0.978516
----3-----
mean loss: 0.074200
accuracy: 0.979004
----4-----
mean loss: 0.075995
accuracy: 0.975098
----0-----
----1-----
eval mean loss: 0.550484
eval accuracy: 0.878247
eval avg class acc: 0.845228
test结果
Namespace(batch_size=4, dump_dir='dump', gpu=0, model='pointnet_cls', model_path='log/model.ckpt', num_point=1024, visu=True)
Model restored.
----0----
----1----
eval mean loss: 0.551200
eval accuracy: 0.878849
eval avg class acc: 0.847773
airplane: 1.000
bathtub: 0.860
bed: 0.970
bench: 0.700
bookshelf: 0.910
bottle: 0.940
bowl: 0.950
car: 0.990
chair: 0.990
cone: 0.900
cup: 0.700
curtain: 0.850
desk: 0.826
door: 0.850
dresser: 0.686
flower_pot: 0.250
glass_box: 0.960
guitar: 1.000
keyboard: 1.000
lamp: 0.800
laptop: 1.000
mantel: 0.950
monitor: 0.950
night_stand: 0.709
person: 0.950
piano: 0.870
plant: 0.770
radio: 0.750
range_hood: 0.920
sink: 0.650
sofa: 0.950
stairs: 0.900
stool: 0.800
table: 0.810
tent: 0.950
toilet: 0.970
tv_stand: 0.780
vase: 0.750
wardrobe: 0.600
xbox: 0.750
一些可视化效果.
2. 部分分割网络
训练log
>>> Training for the epoch 199/200 ...
Loading train file
/pointnet/pointnet/part_seg/./hdf5_data/ply_data_train0.h5
Training Total Mean_loss: 0.082099
Training Label Mean_loss: 3.379165
Training Label Accuracy: 0.050293
Training Seg Mean_loss: 0.082023
Training Seg Accuracy: 0.968230
Loading train file
/pointnet/pointnet/part_seg/./hdf5_data/ply_data_train5.h5
Training Total Mean_loss: 0.081096
Training Label Mean_loss: 3.370121
Training Label Accuracy: 0.055614
Training Seg Mean_loss: 0.081020
Training Seg Accuracy: 0.968714
Loading train file
/pointnet/pointnet/part_seg/./hdf5_data/ply_data_train4.h5
Training Total Mean_loss: 0.081863
Training Label Mean_loss: 3.373602
Training Label Accuracy: 0.058594
Training Seg Mean_loss: 0.081786
Training Seg Accuracy: 0.968368
Loading train file
/pointnet/pointnet/part_seg/./hdf5_data/ply_data_train3.h5
Training Total Mean_loss: 0.081906
Training Label Mean_loss: 3.324682
Training Label Accuracy: 0.056152
Training Seg Mean_loss: 0.081837
Training Seg Accuracy: 0.968433
Loading train file
/pointnet/pointnet/part_seg/./hdf5_data/ply_data_train2.h5
Training Total Mean_loss: 0.080512
Training Label Mean_loss: 3.353689
Training Label Accuracy: 0.060547
Training Seg Mean_loss: 0.080434
Training Seg Accuracy: 0.968954
Loading train file
/pointnet/pointnet/part_seg/./hdf5_data/ply_data_train1.h5
Training Total Mean_loss: 0.081348
Training Label Mean_loss: 3.364903
Training Label Accuracy: 0.059570
Training Seg Mean_loss: 0.081274
Training Seg Accuracy: 0.968459
Successfully store the checkpoint model into train_results/trained_models/epoch_200.ckpt
3.场景语义分割网络
训练log
**** EPOCH 049 ****
----
mean loss: 0.099005
accuracy: 0.964090
----
eval mean loss: 0.577622
eval accuracy: 0.877734
eval avg class acc: 0.754512
以上是关于pointnet 代码复现的主要内容,如果未能解决你的问题,请参考以下文章
pointNet基于pointNet的三维点云目标分类识别matlab仿真
论文简析+解读+Pytorch实现PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation