Pytorch_geometric: PointNet++ Tutorial

Created on 20 Mar 2019  ·  15Comments  ·  Source: rusty1s/pytorch_geometric

❓ Questions & Help


Hello pytorch geometric team,
Thanks for sharing this nice work. I have checked the documentation and found the tutorials mostly about how to deal with graph data.

I am wandering if there is a example or tutorial about how to deal with pure point cloud data (better if there is more information about how to use your pointnet or pointnet++ for further processing)?

Thanks in advance.

feature

Most helpful comment

There is now a PointNet++ example in the examples directory. I will write the accompanying tutorial ASAP.

All 15 comments

This is a great request. I will write a tutorial on how to utilize PointNet and farthest point sampling for classification and segmentation of point clouds.

In the meantime, the benchmark suite for point cloud classification inbenchmark/points might be worth a look.

There is now a PointNet++ example in the examples directory. I will write the accompanying tutorial ASAP.

Thanks @rusty1s . This example helps a lot.
I have checked the modelnet dataset and your example. ModelNet contains .off files while I may need to use .pcd/.bin files. I am wondering if it is possible to create my own dataset containing .pcd/.bin files with the method mentioned in Creating “larger” datasets?

Besides, I hope to know if it is possible to use the default pytorch dataloader to load point cloud one by one and feed the pointConv with tensors like [num_points, coordinates(x,y,z)].

Yes, this is possible. However, this does only work if all your point clouds have the same number of points. The PyTorch dataloader then creates tensors of shape [B, N, 3]. You need to reshape them to [B * N, 3] and create yourself a batch-vector before using the PointConv. This is automatically achieved by using the PyG dataloader.

@rusty1s
There is an error in the pointnet++ example. Please check the following output:
Traceback (most recent call last):
File "pointnet++.py", line 92, in
train(epoch)
File "pointnet++.py", line 72, in train
result = model(data)
File "/home/big/anaconda3/envs/pyg/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(input, *kwargs)
File "pointnet++.py", line 50, in forward
x = self.global_sa(torch.cat([x, pos], dim=1))
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 4096 and 16384 in dimension 0 at /opt/conda/conda-bld/pytorch_1549630534704/work/aten/src/THC/generic/THCTensorMath.cu:83

Specifically,
The two tensors' shape is not matched when trying to concat them in the example:
line 50: x = self.global_sa(torch.cat([x, pos], dim=1))
x: [16348, 256], pos:[4096,3]

I also updated the PointConv. Please update PyG to master.

@rusty1s
I re-clone the repo, 'git pull' shows 'Already up-to-date' and still get the same error.
Could you please re-check the update?

Yes, I re-checked the example. Do not forget to reinstall PyG, either via

python setup.py install

or

python setup.py develop

@rusty1s re-installed and works perfectly. Thanks. Please update the documentation once the tutorial is finished.
Thanks again for this wonderful work.

Hi, @rusty1s

I have recently implemented pointnet++ segmentation model based on your excellent work with the help of pointnet++ example. And the repo also gives an example that pytorch_geometric can mix use with common pytorch dataset and dataloader. @bigsheep2012

Besides, it seems that you would add some examples about segmentation of point clouds. If my implementation can help it, I'd like to add a pull request:)

Really cool! Would love to see a pull request on this one. Thank you!

Hi, @dragonbook
Thank you. Looking forward to your pointnet++ example.

Hi, I'm a postgraduate student who new in programming. I have involve in a project on 'Point Cloud Classification using PointNet++'. The data used is in LAS file. Can somebody help me with this issue. I need to know how to get started with the project. I really appreciate if somebody can help me from the scratch. Please give me any guidelines/references/ sample/ tutorial that I can follow. I looking forward for your help.
Thanks in advance.

I tried my best to write a short tutorial on implementing PointNet++ within PyTorch Geometric, see here.

Was this page helpful?
0 / 5 - 0 ratings