The authors of the PointCNN paper has provided detailed information in the supplementary section of their paper and an open-source PointCNN code repository. The author's implementation is provided in TensorFlow.
PointCNN has other notable implimenatations:
- Point Cloud Segmentation using PointCNN in ArcGIS API for Python
- PyTorch Geometric
- PyTorch implementation from Berkeley CS294-131 Course Proj
PointCNN GitHub Repository
Esri PointCNN
PointCNN Paper Algorithm
Here we will focus on the Esri PointCNN implementation. To Better understand PointCNN let's look at an implementation of the X-Conv algorithm. For a refresher above is the algorithm.
Pypi ArcGIS Page
You can find information to download or install the arcgis Python module here
https://pypi.org/project/arcgis/#files. Download the tar or install the files with pip. Once downloaded find the
file at the path arcgis/learn/models/_pointcnn_utils.py.
We can look at the class PointCNNSeg(nn.Module) declaration to
see Python PointCNN segmentation implementation.
Step 1 of the algorithm happens on line 188:
group_pts = group_pts - center_pts
Step 2 happens on lines 191 and 192:
group_pts = group_pts.permute(0,3,1,2).contiguous()
fts_lifted = self.MLP_delta(group_pts.contiguous()) # (B, C_delta, P, K)
Step 3 happens on lines 194 to 202:
if fts is not None:
_, _, nf = fts.shape
group_fts = fts.contiguous().view(-1, nf)
group_fts = group_fts[k_ind].view(B, self.P, self.K * self.D, nf)
group_fts = group_fts[:, :, rand_col, :]
group_fts = group_fts.permute(0, 3, 1, 2).contiguous()
feat = torch.cat((fts_lifted, group_fts), 1).contiguous() # (B, C_delta + C_in, P, K)
else:
feat = fts_lifted.contiguous()
Step 4 happens on lines 205 and 206:
X = self.MLP_X(group_pts).permute(0,2,3,1) # (B, P, K, K)
X = X.contiguous().view(B*self.P, self.K, self.K)
Step 5 happens on lines 208 and 209:
feat = feat.permute(0,2,3,1).contiguous().view(B*self.P, self.K, -1)
feat = torch.bmm(X, feat).view(B, self.P, self.K, -1).permute(0,3,1,2)
Finally, step 6 happens on line 211:
feat = self.seperable_conv(feat.contiguous())
Summary
We reviewed the key lines of code required to implement the PointCNN algorithm in PyTorch. To take a deeper dive into the PointCNN paper see our post here.


