PointNet++ implementation
See original GitHub issue❓ Questions & Help
Hi, I have some questions about implementation of PointNet++ in examples. First one: now there are the following lines:
idx = fps(pos, batch, ratio=0.5) # 512 points
edge_index = radius(
pos[idx], pos, 0.1, batch[idx], batch, max_num_neighbors=64)
If I understand correctly, it means that we find 64 sampled points for each point from initial point cloud. But in original pointnet++ we should find 64 points from initial point cloud for each sampled point (which is not the same thing). So it seems for me that more correct way is:
idx = fps(pos, batch, ratio=0.5) # 512 points
edge_index = radius(
pos, pos[idx], 0.1, batch, batch[idx], max_num_neighbors=64)
The second question. It seems for me that there is a problem with indices.
idx = fps(pos, batch, ratio=0.25) # 128 points
edge_index = radius(
pos[idx], pos, 0.2, batch[idx], batch, max_num_neighbors=64)
N, M = pos.size(0), idx.size(0)
Let’s assume that idx
has size 1, so there is only 1 sampled point. Then pos[idx]
also has size 1, which means, that edge_index[1]
is [0, ..., 0]
. Now, look at the next line
x = F.relu(self.local_sa2(x, pos, edge_index, size=(N, M)))
Inside PointConv propagate we now have x_i = [x[0], ..., x[0]]
, whereas it should be [x[idx[0]], ..., x[idx[0]]]
. If my understanding is correct, then there is a problem with local and global indices of sampled points.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top GitHub Comments
I think it is, as node features are converted into
(x, None)
format insidePointNetConv
, see https://github.com/pyg-team/pytorch_geometric/blob/master/torch_geometric/nn/conv/point_conv.py#L66-L67. Nonetheless, I changed the example in master to make this more align with other operators, see https://github.com/pyg-team/pytorch_geometric/blob/master/examples/pointnet2_classification.py#L24@rusty1s, @dragonbook , the second issue is not resolved in the current master branch -
https://github.com/pyg-team/pytorch_geometric/blob/master/examples/pointnet2_classification.py