PointNet分类和分割代码复现(跑程序)

分类

代码地址以及相关操作:(https://github.com/charlesq34/pointnet)
分类比较简单,按照网上的步骤很少会出问题,github上边也比较详细,就不具体说明了。

分割

我在运行分割时遇到两个问题

第一:找不到文件夹

 FileNotFoundError: [Errno 2] No such file or directory: '/home/l/Desktop/pointnet-master/part_seg/./PartAnnotation/03001627/points/355fa0f35b61fdd7aa74a6b5ee13e775.pts'

这个因为数据集下载的时候出错了,一共两个数据集,如果运行 sh download_data.sh
下载不下来,可以通过链接下载好,在去运行程序,
train.py运行效果如下:


<<< Testing on the test dataset ...
Loading test file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_val0.h5
	Testing Total Mean_loss: 14097378435.845493
		Testing Label Mean_loss: 528065397.047210
		Testing Label Accuracy: 0.211373
		Testing Seg Mean_loss: 14097378435.845493
		Testing Seg Accuracy: 0.016106

		Category Airplane Object Number: 389
		Category Airplane Label Accuracy: 1.000000
		Category Airplane Seg Accuracy: 0.000000

		Category Bag Object Number: 8
		Category Bag Label Accuracy: 0.000000
		Category Bag Seg Accuracy: 0.000000

		Category Cap Object Number: 5
		Category Cap Label Accuracy: 0.000000
		Category Cap Seg Accuracy: 0.000000

		Category Car Object Number: 79
		Category Car Label Accuracy: 0.000000
		Category Car Seg Accuracy: 0.000000

		Category Chair Object Number: 395
		Category Chair Label Accuracy: 0.000000
		Category Chair Seg Accuracy: 0.000000

		Category Earphone Object Number: 6
		Category Earphone Label Accuracy: 0.000000
		Category Earphone Seg Accuracy: 0.000000

		Category Guitar Object Number: 78
		Category Guitar Label Accuracy: 0.000000
		Category Guitar Seg Accuracy: 0.000000

		Category Knife Object Number: 35
		Category Knife Label Accuracy: 0.000000
		Category Knife Seg Accuracy: 0.000000

		Category Lamp Object Number: 142
		Category Lamp Label Accuracy: 0.000000
		Category Lamp Seg Accuracy: 0.211065

		Category Laptop Object Number: 44
		Category Laptop Label Accuracy: 0.000000
		Category Laptop Seg Accuracy: 0.000000

		Category Motorbike Object Number: 26
		Category Motorbike Label Accuracy: 0.000000
		Category Motorbike Seg Accuracy: 0.000000

		Category Mug Object Number: 16
		Category Mug Label Accuracy: 0.000000
		Category Mug Seg Accuracy: 0.000000

		Category Pistol Object Number: 30
		Category Pistol Label Accuracy: 0.166667
		Category Pistol Seg Accuracy: 0.001693

		Category Rocket Object Number: 8
		Category Rocket Label Accuracy: 0.000000
		Category Rocket Seg Accuracy: 0.000000

		Category Skateboard Object Number: 15
		Category Skateboard Label Accuracy: 0.000000
		Category Skateboard Seg Accuracy: 0.000000

		Category Table Object Number: 588
		Category Table Label Accuracy: 0.000000
		Category Table Seg Accuracy: 0.000000

>>> Training for the epoch 0/200 ...
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train1.h5
	Training Total Mean_loss: 2.208344
		Training Label Mean_loss: 3.707007
		Training Label Accuracy: 0.030273
		Training Seg Mean_loss: 1.779380
		Training Seg Accuracy: 0.546435
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train4.h5
	Training Total Mean_loss: 1.569824
		Training Label Mean_loss: 3.564084
		Training Label Accuracy: 0.027832
		Training Seg Mean_loss: 1.324413
		Training Seg Accuracy: 0.633967
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train0.h5
	Training Total Mean_loss: 0.963046
		Training Label Mean_loss: 3.551116
		Training Label Accuracy: 0.027344
		Training Seg Mean_loss: 0.925087
		Training Seg Accuracy: 0.726815
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train2.h5
	Training Total Mean_loss: 0.797747
		Training Label Mean_loss: 3.585615
		Training Label Accuracy: 0.032715
		Training Seg Mean_loss: 0.775099
		Training Seg Accuracy: 0.766800
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train5.h5
	Training Total Mean_loss: 2.528071
		Training Label Mean_loss: 3.569277
		Training Label Accuracy: 0.026899
		Training Seg Mean_loss: 0.916843
		Training Seg Accuracy: 0.723155
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train3.h5
	Training Total Mean_loss: 3.322942
		Training Label Mean_loss: 3.470755
		Training Label Accuracy: 0.033203
		Training Seg Mean_loss: 1.223184
		Training Seg Accuracy: 0.650061

<<< Testing on the test dataset ...
Loading test file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_val0.h5
	Testing Total Mean_loss: 1.655914
		Testing Label Mean_loss: 6.365255
		Testing Label Accuracy: 0.019850
		Testing Seg Mean_loss: 1.061547
		Testing Seg Accuracy: 0.743527

		Category Airplane Object Number: 389
		Category Airplane Label Accuracy: 0.025707
		Category Airplane Seg Accuracy: 0.761382

		Category Bag Object Number: 8
		Category Bag Label Accuracy: 0.000000
		Category Bag Seg Accuracy: 0.000000

		Category Cap Object Number: 5
		Category Cap Label Accuracy: 0.000000
		Category Cap Seg Accuracy: 0.003223

		Category Car Object Number: 79
		Category Car Label Accuracy: 0.000000
		Category Car Seg Accuracy: 0.755044

		Category Chair Object Number: 395
		Category Chair Label Accuracy: 0.000000
		Category Chair Seg Accuracy: 0.595826

		Category Earphone Object Number: 6
		Category Earphone Label Accuracy: 0.000000
		Category Earphone Seg Accuracy: 0.000000

		Category Guitar Object Number: 78
		Category Guitar Label Accuracy: 0.025641
		Category Guitar Seg Accuracy: 0.855669

		Category Knife Object Number: 35
		Category Knife Label Accuracy: 0.000000
		Category Knife Seg Accuracy: 0.029408

		Category Lamp Object Number: 142
		Category Lamp Label Accuracy: 0.147887
		Category Lamp Seg Accuracy: 0.644246

		Category Laptop Object Number: 44
		Category Laptop Label Accuracy: 0.000000
		Category Laptop Seg Accuracy: 0.521717

		Category Motorbike Object Number: 26
		Category Motorbike Label Accuracy: 0.000000
		Category Motorbike Seg Accuracy: 0.642597

		Category Mug Object Number: 16
		Category Mug Label Accuracy: 0.000000
		Category Mug Seg Accuracy: 0.722504

		Category Pistol Object Number: 30
		Category Pistol Label Accuracy: 0.133333
		Category Pistol Seg Accuracy: 0.892220

		Category Rocket Object Number: 8
		Category Rocket Label Accuracy: 0.000000
		Category Rocket Seg Accuracy: 0.509094

		Category Skateboard Object Number: 15
		Category Skateboard Label Accuracy: 0.000000
		Category Skateboard Seg Accuracy: 0.675228

		Category Table Object Number: 588
		Category Table Label Accuracy: 0.000000
		Category Table Seg Accuracy: 0.923971

>>> Training for the epoch 1/200 ...
Loading train file /home/l/Desktop/pointnet-master/part_seg/./hdf5_data/ply_data_train3.h5
	Training Total Mean_loss: 1.112694
		Training Label Mean_loss: 3.481067
		Training Label Accuracy: 0.041992
		Training Seg Mean_loss: 0.951263
		Training Seg Accuracy: 0.713590

第二:在运行过程中会显示:资源消耗完了(翻译过来大概)

这个是batch_size太大了,去程序里面改小,8或者4,就可以啦。

test.py运行结果如下:

Loading model train_results/trained_models/epoch_190.ckpt
Model restored.
0/2874 ...
100/2874 ...
200/2874 ...
300/2874 ...
400/2874 ...
500/2874 ...
600/2874 ...
700/2874 ...
800/2874 ...
900/2874 ...
1000/2874 ...
1100/2874 ...
1200/2874 ...
1300/2874 ...
1400/2874 ...
1500/2874 ...
1600/2874 ...
1700/2874 ...
1800/2874 ...
1900/2874 ...
2000/2874 ...
2100/2874 ...
2200/2874 ...
2300/2874 ...
2400/2874 ...
2500/2874 ...
2600/2874 ...
2700/2874 ...
2800/2874 ...
Accuracy: 0.926577
IoU: 0.816931
	 02691156 Total Number: 341
	 02691156 Accuracy: 0.9127049599924395
	 02691156 IoU: 0.8307283910488453
	 02773838 Total Number: 14
	 02773838 Accuracy: 0.948321955544608
	 02773838 IoU: 0.7573385238647461
	 02954340 Total Number: 11
	 02954340 Accuracy: 0.8903708891435103
	 02954340 IoU: 0.7879825938831676
	 02958343 Total Number: 158
	 02958343 Accuracy: 0.9067590447920787
	 02958343 IoU: 0.7461091053636768
	 03001627 Total Number: 704
	 03001627 Accuracy: 0.9405029470270331
	 03001627 IoU: 0.8934942592274059
	 03261776 Total Number: 14
	 03261776 Accuracy: 0.9187915665762765
	 03261776 IoU: 0.7400967734200614
	 03467517 Total Number: 159
	 03467517 Accuracy: 0.9655065956355641
	 03467517 IoU: 0.9105948202265134
	 03624134 Total Number: 80
	 03624134 Accuracy: 0.9240625381469727
	 03624134 IoU: 0.8528668403625488
	 03636649 Total Number: 286
	 03636649 Accuracy: 0.900685450413844
	 03636649 IoU: 0.7965391465833971
	 03642806 Total Number: 83
	 03642806 Accuracy: 0.977536672569183
	 03642806 IoU: 0.9512975302087255
	 03790512 Total Number: 51
	 03790512 Accuracy: 0.8602656196145451
	 03790512 IoU: 0.6449186287674249
	 03797390 Total Number: 38
	 03797390 Accuracy: 0.9925226914255243
	 03797390 IoU: 0.9128187079178659
	 03948459 Total Number: 44
	 03948459 Accuracy: 0.9535756544633345
	 03948459 IoU: 0.8133323842828925
	 04099429 Total Number: 12
	 04099429 Accuracy: 0.8038069407145182
	 04099429 IoU: 0.5588903824488322
	 04225987 Total Number: 31
	 04225987 Accuracy: 0.9447346964190083
	 04225987 IoU: 0.7312387651012789
	 04379243 Total Number: 848
	 04379243 Accuracy: 0.9219124991938753
	 04379243 IoU: 0.7494366483868293
在这里会生成许多obj文件,这是对应分割的每一部分,通过软件CloudCompare软件可以查看。

你可能感兴趣的:(小书python成长记录,pointnet,分类,分割)